Instance type in invite notification, small fixes

This commit is contained in:
Natsumi
2021-08-06 02:32:44 +12:00
parent e8a64af18c
commit 97a1e57259
2 changed files with 17 additions and 11 deletions

View File

@@ -877,18 +877,21 @@ speechSynthesis.getVoices();
}
var bias = new Date(Date.now() - 60000).toJSON();
var noty = {};
var messageList = [ 'inviteMessage', 'requestMessage', 'responseMessage' ];
var messageList = ['inviteMessage', 'requestMessage', 'responseMessage'];
for (var i = 0; i < notyToPlay.length; i++) {
noty = notyToPlay[i];
if (noty.created_at < bias) {
continue;
}
var message = '';
for (i = 0; i < messageList.length; i++) {
if (typeof noty.details !== 'undefined' && typeof noty.details[messageList[i]] !== 'undefined') {
message = noty.details[messageList[i]];
for (var k = 0; k < messageList.length; k++) {
if (typeof noty.details !== 'undefined' && typeof noty.details[messageList[k]] !== 'undefined') {
message = noty.details[messageList[k]];
}
}
if (message) {
message = `, ${message}`;
}
if ((this.config.overlayNotifications) && (!this.isGameNoVR) && (this.isGameRunning)) {
var text = '';
switch (noty.type) {
@@ -914,7 +917,7 @@ speechSynthesis.getVoices();
text = `<strong>${noty.displayName}</strong> status is now <i>${noty.status}</i> ${noty.statusDescription}`;
break;
case 'invite':
text = `<strong>${noty.senderUsername}</strong> has invited you to ${noty.details.worldName} ${message}`;
text = `<strong>${noty.senderUsername}</strong> has invited you to ${this.displayLocation(noty.details.worldId, noty.details.worldName)}${message}`;
break;
case 'requestInvite':
text = `<strong>${noty.senderUsername}</strong> has requested an invite ${message}`;