cleanup code

This commit is contained in:
pypy
2020-01-13 22:53:01 +09:00
parent 129259cd1e
commit 727a552083

View File

@@ -3885,56 +3885,57 @@ CefSharp.BindObjectAsync(
API.$on('USER:UPDATE', function (args) {
var { ref, props } = args;
if ($app.friends.get(ref.id)) {
if (props.location) {
if (props.location[0] === 'offline') {
$app.addFeed('Offline', ref, {
location: props.location[1],
time: props.location[2]
});
} else if (props.location[1] === 'offline') {
$app.addFeed('Online', ref, {
location: props.location[0]
});
} else {
$app.addFeed('GPS', ref, {
location: [
props.location[0],
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 ($app.friends.has(ref.id) === false) {
return;
}
if (props.location) {
if (props.location[0] === 'offline') {
$app.addFeed('Offline', ref, {
location: props.location[1],
time: props.location[2]
});
} else if (props.location[1] === 'offline') {
$app.addFeed('Online', ref, {
location: props.location[0]
});
} else {
$app.addFeed('GPS', ref, {
location: [
props.location[0],
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
}
]
});
}
});
var saveFeedTimer = null;