mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 14:46:04 +02:00
friend log notifications
This commit is contained in:
+37
-49
@@ -727,6 +727,14 @@ speechSynthesis.getVoices();
|
|||||||
notys.push(feed);
|
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 bias = new Date(Date.now() - 60000).toJSON();
|
||||||
var theme = 'relax';
|
var theme = 'relax';
|
||||||
@@ -736,70 +744,44 @@ speechSynthesis.getVoices();
|
|||||||
notys.forEach((noty) => {
|
notys.forEach((noty) => {
|
||||||
if (noty.created_at > bias) {
|
if (noty.created_at > bias) {
|
||||||
if (configRepository.getBool('VRCX_overlayNotifications')) {
|
if (configRepository.getBool('VRCX_overlayNotifications')) {
|
||||||
|
var text = '';
|
||||||
switch (noty.type) {
|
switch (noty.type) {
|
||||||
case 'OnPlayerJoined':
|
case 'OnPlayerJoined':
|
||||||
new Noty({
|
text = `<strong>${noty.data}</strong> has joined`;
|
||||||
type: 'alert',
|
|
||||||
theme: theme,
|
|
||||||
timeout: notificationTimeout,
|
|
||||||
layout: notificationPosition,
|
|
||||||
text: `<strong>${noty.data}</strong> has joined`
|
|
||||||
}).show();
|
|
||||||
break;
|
break;
|
||||||
case 'OnPlayerLeft':
|
case 'OnPlayerLeft':
|
||||||
new Noty({
|
text = `<strong>${noty.data}</strong> has left`;
|
||||||
type: 'alert',
|
|
||||||
theme: theme,
|
|
||||||
timeout: notificationTimeout,
|
|
||||||
layout: notificationPosition,
|
|
||||||
text: `<strong>${noty.data}</strong> has left`
|
|
||||||
}).show();
|
|
||||||
break;
|
break;
|
||||||
case 'Online':
|
case 'Online':
|
||||||
new Noty({
|
text = `<strong>${noty.displayName}</strong> has logged in`;
|
||||||
type: 'alert',
|
|
||||||
theme: theme,
|
|
||||||
timeout: notificationTimeout,
|
|
||||||
layout: notificationPosition,
|
|
||||||
text: `<strong>${noty.displayName}</strong> has logged in`
|
|
||||||
}).show();
|
|
||||||
break;
|
break;
|
||||||
case 'Offline':
|
case 'Offline':
|
||||||
new Noty({
|
text = `<strong>${noty.displayName}</strong> has logged out`;
|
||||||
type: 'alert',
|
|
||||||
theme: theme,
|
|
||||||
timeout: notificationTimeout,
|
|
||||||
layout: notificationPosition,
|
|
||||||
text: `<strong>${noty.displayName}</strong> has logged out`
|
|
||||||
}).show();
|
|
||||||
break;
|
break;
|
||||||
case 'invite':
|
case 'invite':
|
||||||
new Noty({
|
text = `<strong>${noty.senderUsername}</strong> has invited you to ${noty.details.worldName}`;
|
||||||
type: 'alert',
|
|
||||||
theme: theme,
|
|
||||||
timeout: notificationTimeout,
|
|
||||||
layout: notificationPosition,
|
|
||||||
text: `<strong>${noty.senderUsername}</strong> has invited you to ${noty.details.worldName}`
|
|
||||||
}).show();
|
|
||||||
break;
|
break;
|
||||||
case 'requestInvite':
|
case 'requestInvite':
|
||||||
new Noty({
|
text = `<strong>${noty.senderUsername}</strong> has requested an invite`;
|
||||||
type: 'alert',
|
|
||||||
theme: theme,
|
|
||||||
timeout: notificationTimeout,
|
|
||||||
layout: notificationPosition,
|
|
||||||
text: `<strong>${noty.senderUsername}</strong> has requested an invite`
|
|
||||||
}).show();
|
|
||||||
break;
|
break;
|
||||||
case 'friendRequest':
|
case 'friendRequest':
|
||||||
new Noty({
|
text = `<strong>${noty.senderUsername}</strong> has sent you a friend request`;
|
||||||
type: 'alert',
|
|
||||||
theme: theme,
|
|
||||||
timeout: notificationTimeout,
|
|
||||||
layout: notificationPosition,
|
|
||||||
text: `<strong>${noty.senderUsername}</strong> has sent you a friend request`
|
|
||||||
}).show();
|
|
||||||
break;
|
break;
|
||||||
|
case 'Friend':
|
||||||
|
text = `<strong>${noty.displayName}</strong> is now your friend`;
|
||||||
|
break;
|
||||||
|
case 'Unfriend':
|
||||||
|
text = `<strong>${noty.displayName}</strong> has unfriended you`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (text) {
|
||||||
|
new Noty({
|
||||||
|
type: 'alert',
|
||||||
|
theme: theme,
|
||||||
|
timeout: notificationTimeout,
|
||||||
|
layout: notificationPosition,
|
||||||
|
text: text
|
||||||
|
}).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (configRepository.getBool('VRCX_notificationTTS')) {
|
if (configRepository.getBool('VRCX_notificationTTS')) {
|
||||||
@@ -825,6 +807,12 @@ speechSynthesis.getVoices();
|
|||||||
case 'friendRequest':
|
case 'friendRequest':
|
||||||
this.speak(`${noty.senderUsername} has sent you a friend request`);
|
this.speak(`${noty.senderUsername} has sent you a friend request`);
|
||||||
break;
|
break;
|
||||||
|
case 'Friend':
|
||||||
|
this.speak(`${noty.displayName} is now your friend`);
|
||||||
|
break;
|
||||||
|
case 'Unfriend':
|
||||||
|
this.speak(`${noty.displayName} has unfriended you`);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user