Add Moderation Logs to shared feed

This commit is contained in:
Natsumi
2021-01-18 06:40:22 +13:00
parent 5c399d5f2f
commit 8cf966dcbc
4 changed files with 166 additions and 11 deletions

View File

@@ -769,12 +769,16 @@ speechSynthesis.getVoices();
((filter[feed.type] === 'Friends') && (feed.isFriend)) ||
((filter[feed.type] === 'VIP') && (feed.isFavorite)))) {
var displayName = '';
if (feed.data) {
displayName = feed.data;
} else if (feed.displayName) {
if (feed.displayName) {
displayName = feed.displayName;
} else if (feed.senderUsername) {
displayName = feed.senderUsername;
} else if (feed.sourceDisplayName) {
displayName = feed.sourceDisplayName;
} else if (feed.data) {
displayName = feed.data;
} else {
console.error('missing displayName');
}
if ((displayName) && (!this.notyMap[displayName]) ||
(this.notyMap[displayName] < feed.created_at)) {
@@ -943,6 +947,8 @@ speechSynthesis.getVoices();
displayName = feed.displayName;
} else if (feed.senderUsername) {
displayName = feed.senderUsername;
} else if (feed.sourceDisplayName) {
displayName = feed.sourceDisplayName;
} else if (feed.data) {
displayName = feed.data;
} else {
@@ -1011,6 +1017,21 @@ speechSynthesis.getVoices();
case 'DisplayName':
text = `<strong>${noty.previousDisplayName}</strong> changed their name to ${noty.displayName}`;
break;
case 'showAvatar':
text = `<strong>${noty.sourceDisplayName}</strong> has shown your avatar`;
break;
case 'hideAvatar':
text = `<strong>${noty.sourceDisplayName}</strong> has hidden your avatar`;
break;
case 'block':
text = `<strong>${noty.sourceDisplayName}</strong> has blocked you`;
break;
case 'mute':
text = `<strong>${noty.sourceDisplayName}</strong> has muted you`;
break;
case 'unmute':
text = `<strong>${noty.sourceDisplayName}</strong> has unmuted you`;
break;
}
if (text) {
new Noty({
@@ -1066,6 +1087,21 @@ speechSynthesis.getVoices();
case 'DisplayName':
this.speak(`${noty.previousDisplayName} changed their name to ${noty.displayName}`);
break;
case 'showAvatar':
this.speak(`${noty.sourceDisplayName} has shown your avatar`);
break;
case 'hideAvatar':
this.speak(`${noty.sourceDisplayName} has hidden your avatar`);
break;
case 'block':
this.speak(`${noty.sourceDisplayName} has blocked you`);
break;
case 'mute':
this.speak(`${noty.sourceDisplayName} has muted you`);
break;
case 'unmute':
this.speak(`${noty.sourceDisplayName} has unmuted you`);
break;
}
}
if ((this.desktopToastToggle) && (this.isGameNoVR)) {