cleanup code

This commit is contained in:
pypy
2020-01-13 22:53:01 +09:00
parent 129259cd1e
commit 727a552083
+48 -47
View File
@@ -3885,56 +3885,57 @@ CefSharp.BindObjectAsync(
API.$on('USER:UPDATE', function (args) { API.$on('USER:UPDATE', function (args) {
var { ref, props } = args; var { ref, props } = args;
if ($app.friends.get(ref.id)) { if ($app.friends.has(ref.id) === false) {
if (props.location) { return;
if (props.location[0] === 'offline') { }
$app.addFeed('Offline', ref, { if (props.location) {
location: props.location[1], if (props.location[0] === 'offline') {
time: props.location[2] $app.addFeed('Offline', ref, {
}); location: props.location[1],
} else if (props.location[1] === 'offline') { time: props.location[2]
$app.addFeed('Online', ref, { });
location: props.location[0] } else if (props.location[1] === 'offline') {
}); $app.addFeed('Online', ref, {
} else { location: props.location[0]
$app.addFeed('GPS', ref, { });
location: [ } else {
props.location[0], $app.addFeed('GPS', ref, {
props.location[1] location: [
], props.location[0],
time: props.location[2] props.location[1]
}); ],
} time: props.location[2]
}
if (props.currentAvatarThumbnailImageUrl) {
$app.addFeed('Avatar', ref, {
avatar: props.currentAvatarThumbnailImageUrl
});
}
if (props.status ||
props.statusDescription) {
$app.addFeed('Status', ref, {
status: [
{
status: props.status
? props.status[0]
: ref.status,
statusDescription: props.statusDescription
? props.statusDescription[0]
: ref.statusDescription
},
{
status: props.status
? props.status[1]
: ref.status,
statusDescription: props.statusDescription
? props.statusDescription[1]
: ref.statusDescription
}
]
}); });
} }
} }
if (props.currentAvatarThumbnailImageUrl) {
$app.addFeed('Avatar', ref, {
avatar: props.currentAvatarThumbnailImageUrl
});
}
if (props.status ||
props.statusDescription) {
$app.addFeed('Status', ref, {
status: [
{
status: props.status
? props.status[0]
: ref.status,
statusDescription: props.statusDescription
? props.statusDescription[0]
: ref.statusDescription
},
{
status: props.status
? props.status[1]
: ref.status,
statusDescription: props.statusDescription
? props.statusDescription[1]
: ref.statusDescription
}
]
});
}
}); });
var saveFeedTimer = null; var saveFeedTimer = null;