diff --git a/html/src/index.pug b/html/src/index.pug index 95d2d015..d972f543 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -782,7 +782,7 @@ html el-tab-pane(label="Info") div(v-if="userDialog.ref.location" style="display:flex;flex-direction:column;margin-bottom:10px;padding-bottom:10px;border-bottom:1px solid #eee") div(style="flex:none") - location(:location="userDialog.ref.location") + location(:location="userDialog.ref.location") template(#default v-if="userDialog.instance.occupants") ({{ userDialog.instance.occupants }}) launch(:location="userDialog.ref.location" style="margin-left:5px") invite-yourself(:location="userDialog.ref.location" style="margin-left:5px") diff --git a/html/src/vr.js b/html/src/vr.js index 82d58bbc..e309dba8 100644 --- a/html/src/vr.js +++ b/html/src/vr.js @@ -727,6 +727,14 @@ speechSynthesis.getVoices(); notys.push(feed); } } + if (feed.type === 'Friend' || + feed.type === 'Unfriend') { + if (!map[feed.displayName] || + map[feed.displayName] < feed.created_at) { + map[feed.displayName] = feed.created_at; + notys.push(feed); + } + } }); var bias = new Date(Date.now() - 60000).toJSON(); var theme = 'relax'; @@ -736,70 +744,44 @@ speechSynthesis.getVoices(); notys.forEach((noty) => { if (noty.created_at > bias) { if (configRepository.getBool('VRCX_overlayNotifications')) { + var text = ''; switch (noty.type) { case 'OnPlayerJoined': - new Noty({ - type: 'alert', - theme: theme, - timeout: notificationTimeout, - layout: notificationPosition, - text: `${noty.data} has joined` - }).show(); + text = `${noty.data} has joined`; break; case 'OnPlayerLeft': - new Noty({ - type: 'alert', - theme: theme, - timeout: notificationTimeout, - layout: notificationPosition, - text: `${noty.data} has left` - }).show(); + text = `${noty.data} has left`; break; case 'Online': - new Noty({ - type: 'alert', - theme: theme, - timeout: notificationTimeout, - layout: notificationPosition, - text: `${noty.displayName} has logged in` - }).show(); + text = `${noty.displayName} has logged in`; break; case 'Offline': - new Noty({ - type: 'alert', - theme: theme, - timeout: notificationTimeout, - layout: notificationPosition, - text: `${noty.displayName} has logged out` - }).show(); + text = `${noty.displayName} has logged out`; break; case 'invite': - new Noty({ - type: 'alert', - theme: theme, - timeout: notificationTimeout, - layout: notificationPosition, - text: `${noty.senderUsername} has invited you to ${noty.details.worldName}` - }).show(); + text = `${noty.senderUsername} has invited you to ${noty.details.worldName}`; break; case 'requestInvite': - new Noty({ - type: 'alert', - theme: theme, - timeout: notificationTimeout, - layout: notificationPosition, - text: `${noty.senderUsername} has requested an invite` - }).show(); + text = `${noty.senderUsername} has requested an invite`; break; case 'friendRequest': - new Noty({ - type: 'alert', - theme: theme, - timeout: notificationTimeout, - layout: notificationPosition, - text: `${noty.senderUsername} has sent you a friend request` - }).show(); + text = `${noty.senderUsername} has sent you a friend request`; break; + case 'Friend': + text = `${noty.displayName} is now your friend`; + break; + case 'Unfriend': + text = `${noty.displayName} has unfriended you`; + break; + } + if (text) { + new Noty({ + type: 'alert', + theme: theme, + timeout: notificationTimeout, + layout: notificationPosition, + text: text + }).show(); } } if (configRepository.getBool('VRCX_notificationTTS')) { @@ -825,6 +807,12 @@ speechSynthesis.getVoices(); case 'friendRequest': this.speak(`${noty.senderUsername} has sent you a friend request`); break; + case 'Friend': + this.speak(`${noty.displayName} is now your friend`); + break; + case 'Unfriend': + this.speak(`${noty.displayName} has unfriended you`); + break; } } }