1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-20 00:25:17 +00:00

Can create groups membership notifications (moderator > user)

This commit is contained in:
2020-03-24 18:47:34 +01:00
parent 9ced519618
commit 59925dab45
4 changed files with 65 additions and 4 deletions

View File

@ -113,7 +113,30 @@ export class NotificationsHelper {
}
// TODO : continue
// Groups membership notifications
else if (n.onElemType == NotifElemType.GROUP_MEMBERSHIP) {
// Complete the notification
n.fromContainerType = NotifElemType.EMPTY;
n.fromContainerID = 0;
// Check whether the notification has to be pushed to a single user
// or to all the moderators of the group
if(n.hasDestUserID) {
//Push the notification in private way (if it has a destination,
//generally the target user of the membership request)
await this.PushPrivate(n);
}
else {
// Push the notification to all the moderators of the group
throw new Error("//TODO Push notification to all members of the group");
}
}
// Unsupported notification type
else {