This commit is contained in:
Natsumi
2022-09-17 02:21:11 +12:00
parent e61fa926c5
commit 03faa57128
2 changed files with 22 additions and 20 deletions

View File

@@ -1964,15 +1964,21 @@ speechSynthesis.getVoices();
instanceId: string
}
*/
API.getInstanceShortName = function (params) {
API.getInstanceShortName = function (instance) {
var params = {};
if (instance.shortName) {
params.shortName = instance.shortName;
}
return this.call(
`instances/${params.worldId}:${params.instanceId}/shortName`,
`instances/${instance.worldId}:${instance.instanceId}/shortName`,
{
method: 'GET'
method: 'GET',
params
}
).then((json) => {
var args = {
json,
instance,
params
};
this.$emit('INSTANCE:SHORTNAME', args);
@@ -6844,15 +6850,13 @@ speechSynthesis.getVoices();
);
}
var newRef = args.ref;
if (ctx.state !== newState) {
if (ctx.state !== newState && ctx.ref !== 'undefined') {
if (
(newState === 'offline' || newState === 'active') &&
ctx.state === 'online'
) {
if (ctx.ref !== 'undefined') {
ctx.ref.$online_for = '';
ctx.ref.$offline_for = Date.now();
}
ctx.ref.$online_for = '';
ctx.ref.$offline_for = Date.now();
var ts = Date.now();
var time = ts - $location_at;
var worldName = await this.getWorldName(location);
@@ -6868,13 +6872,11 @@ speechSynthesis.getVoices();
this.addFeed(feed);
database.addOnlineOfflineToDatabase(feed);
} else if (newState === 'online') {
if (ctx.ref !== 'undefined') {
ctx.ref.$previousLocation = '';
ctx.ref.$travelingToTime = Date.now();
ctx.ref.$location_at = Date.now();
ctx.ref.$online_for = Date.now();
ctx.ref.$offline_for = '';
}
ctx.ref.$previousLocation = '';
ctx.ref.$travelingToTime = Date.now();
ctx.ref.$location_at = Date.now();
ctx.ref.$online_for = Date.now();
ctx.ref.$offline_for = '';
var worldName = await this.getWorldName(newRef.location);
var feed = {
created_at: new Date().toJSON(),
@@ -7639,7 +7641,8 @@ speechSynthesis.getVoices();
API.$on('USER:UPDATE', async function (args) {
var {ref, props} = args;
if ($app.friends.has(ref.id) === false) {
var friend = $app.friends.get(ref.id);
if (typeof friend === 'undefined') {
return;
}
if (props.location && ref.id === $app.userDialog.id) {
@@ -7687,6 +7690,9 @@ speechSynthesis.getVoices();
ref.$previousLocation = '';
ref.$travelingToTime = Date.now();
}
if (friend.state !== 'online') {
API.getUser({userId: ref.id});
}
}
if (
props.location &&

View File

@@ -106,10 +106,6 @@
margin-left: 5px;
}
.el-message-box__message p {
word-break: break-all;
}
::-webkit-scrollbar {
width: 8px;
height: 8px;