diff --git a/html/src/app.js b/html/src/app.js index 22d2fcd0..dd0d767e 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -740,26 +740,16 @@ speechSynthesis.getVoices(); L.worldId === '') { return; } - API.getCachedWorld({ - worldId: L.worldId - }).then((args) => { - if (API.currentUser.status === 'busy') { - this.$message({ - message: 'You can\'t invite yourself in \'Do Not Disturb\' mode', + if (API.currentUser.status === 'busy') { + this.$message({ + message: 'You can\'t invite yourself in \'Do Not Disturb\' mode', type: 'error' - }); - return; - } - API.sendInvite({ - instanceId: L.tag, - worldId: L.tag, - worldName: args.ref.name - }, API.currentUser.id).finally(() => { - this.$message({ - message: 'Invite sent to yourself', - type: 'success' - }); }); + return; + } + API.selfInvite({ + instanceId: L.instanceId, + worldId: L.worldId }); } }, @@ -1193,6 +1183,9 @@ speechSynthesis.getVoices(); json.statusDescription = API.currentUser.statusDescription; json.state = API.currentUser.state; json.last_login = API.currentUser.last_login; + if ((typeof json.location !== 'undefined') && (json.location === 'offline')) { + json.location = ''; + } if ($app.lastLocation.location) { json.location = $app.lastLocation.location; json.$location_at = $app.lastLocation.date; @@ -1638,6 +1631,24 @@ speechSynthesis.getVoices(); }); }; + /* + params: { + worldId: string, + instanceId: string + } + */ + API.selfInvite = function (params) { + return this.call(`instances/${params.worldId}:${params.instanceId}/invite`, { + method: 'POST' + }).then((json) => { + var args = { + json, + params + }; + return args; + }); + }; + API.$on('INSTANCE', function (args) { var { json } = args; var D = $app.userDialog; @@ -3294,6 +3305,14 @@ speechSynthesis.getVoices(); }); break; + case 'hide-notification': + this.$emit('NOTIFICATION:SEE', { + params: { + notificationId: content + } + }); + break; + case 'friend-add': this.$emit('USER', { json: content.user, @@ -9812,27 +9831,16 @@ speechSynthesis.getVoices(); L.worldId === '') { return; } - API.getCachedWorld({ - worldId: L.worldId - }).then((args) => { - if (API.currentUser.status === 'busy') { - this.$message({ - message: 'You can\'t invite yourself in \'Do Not Disturb\' mode', + if (API.currentUser.status === 'busy') { + this.$message({ + message: 'You can\'t invite yourself in \'Do Not Disturb\' mode', type: 'error' - }); - return; - } - API.sendInvite({ - instanceId: L.tag, - worldId: L.tag, - worldName: args.ref.name - }, API.currentUser.id).finally(() => { - this.newInstanceDialog.visible = false; - this.$message({ - message: 'Invite sent to yourself', - type: 'success' - }); }); + return; + } + API.selfInvite({ + instanceId: L.instanceId, + worldId: L.worldId }); }; diff --git a/html/src/app.scss b/html/src/app.scss index b4cc873b..7a7b34a6 100644 --- a/html/src/app.scss +++ b/html/src/app.scss @@ -298,11 +298,13 @@ img.friends-list-avatar { object-fit: cover; } -.x-friend-item > .avatar.offline > img { +.x-friend-item > .avatar.offline > img, +.x-friend-item > .avatar.active > img { filter: grayscale(1); } -.x-friend-item:hover > .avatar.offline > img { +.x-friend-item:hover > .avatar.offline > img, +.x-friend-item:hover > .avatar.active > img { filter: none; }