Invites in feed and notifications

This commit is contained in:
Natsumi
2020-11-19 01:28:00 +13:00
committed by pypy
parent 0291211e4f
commit fd36751019
4 changed files with 50 additions and 9 deletions

View File

@@ -672,12 +672,18 @@ import webApiService from './service/webapi.js';
}
}
}
if (feed.type === 'invite') {
if (!map[feed.senderUsername] ||
map[feed.senderUsername] < feed.created_at) {
map[feed.senderUsername] = feed.created_at;
}
}
});
// disable notification on busy
if (this.currentUserStatus === 'busy') {
return;
}
if (configRepository.getBool('VRCX_VIPNotifications') === true) {
if (configRepository.getBool('VRCX_overlayNotifications') === true) {
var notys = [];
this.feeds.forEach((feed) => {
if (feed.isFavorite) {
@@ -697,6 +703,13 @@ import webApiService from './service/webapi.js';
}
}
}
if (feed.type === 'invite') {
if (!map[feed.senderUsername] ||
map[feed.senderUsername] < feed.created_at) {
map[feed.senderUsername] = feed.created_at;
notys.push(feed);
}
}
});
var bias = new Date(Date.now() - 60000).toJSON();
var theme = 'relax';
@@ -734,6 +747,13 @@ import webApiService from './service/webapi.js';
text: `<strong>${noty.displayName}</strong> has logged out`
}).show();
break;
case 'invite':
new Noty({
type: 'alert',
theme: theme,
text: `<strong>${noty.senderUsername}</strong> has invited you to ${noty.details.worldName}`
}).show();
break;
}
}
});