Fixes and changes

This commit is contained in:
Natsumi
2021-06-12 21:04:54 +12:00
parent afe7fa98aa
commit 5beae400d8
2 changed files with 49 additions and 39 deletions

View File

@@ -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
});
};

View File

@@ -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;
}