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