Request invites and friend requests

This commit is contained in:
Natsumi
2020-11-19 06:44:03 +13:00
committed by pypy
parent fd36751019
commit e0fb98d86c
2 changed files with 60 additions and 0 deletions

View File

@@ -678,6 +678,18 @@ import webApiService from './service/webapi.js';
map[feed.senderUsername] = feed.created_at;
}
}
else if (feed.type === 'requestInvite') {
if (!map[feed.senderUsername] ||
map[feed.senderUsername] < feed.created_at) {
map[feed.senderUsername] = feed.created_at;
}
}
else if (feed.type === 'friendRequest') {
if (!map[feed.senderUsername] ||
map[feed.senderUsername] < feed.created_at) {
map[feed.senderUsername] = feed.created_at;
}
}
});
// disable notification on busy
if (this.currentUserStatus === 'busy') {
@@ -710,6 +722,20 @@ import webApiService from './service/webapi.js';
notys.push(feed);
}
}
else if (feed.type === 'requestInvite') {
if (!map[feed.senderUsername] ||
map[feed.senderUsername] < feed.created_at) {
map[feed.senderUsername] = feed.created_at;
notys.push(feed);
}
}
else if (feed.type === 'friendRequest') {
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';
@@ -754,6 +780,20 @@ import webApiService from './service/webapi.js';
text: `<strong>${noty.senderUsername}</strong> has invited you to ${noty.details.worldName}`
}).show();
break;
case 'requestInvite':
new Noty({
type: 'alert',
theme: theme,
text: `<strong>${noty.senderUsername}</strong> has requested an invite`
}).show();
break;
case 'friendRequest':
new Noty({
type: 'alert',
theme: theme,
text: `<strong>${noty.senderUsername}</strong> has sent you a friend request`
}).show();
break;
}
}
});