mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 05:49:22 +00:00
Support group membership notifications
This commit is contained in:
parent
837bc35a6b
commit
04b80782dc
@ -38,6 +38,20 @@ ComunicWeb.components.notifications.ui = {
|
||||
if(data.type == "rejected_friend_request")
|
||||
message += "rejected your friendship request.";
|
||||
|
||||
//About group membership
|
||||
if(data.type == "sent_group_membership_invitation")
|
||||
message += "invited you to join the group";
|
||||
if(data.type == "accepted_group_membership_invitation")
|
||||
message += "accepted his invitation to join the group";
|
||||
if(data.type == "rejected_group_membership_invitation")
|
||||
message += "rejected his invitation to join the group";
|
||||
if(data.type == "sent_group_membership_request")
|
||||
message += "sent a request to join the group";
|
||||
if(data.type == "accepted_group_membership_request")
|
||||
message += "accepted your request to join the group";
|
||||
if(data.type == "rejected_group_membership_request")
|
||||
message += "rejected your request to join the group";
|
||||
|
||||
//Generic element creation
|
||||
if(data.type == "elem_created"){
|
||||
|
||||
@ -65,7 +79,9 @@ ComunicWeb.components.notifications.ui = {
|
||||
message += "on the group "+groups[data.from_container_id].name+".";
|
||||
}
|
||||
|
||||
|
||||
//Group membership
|
||||
if(data.on_elem_type == "group_membership")
|
||||
message += groups[data.on_elem_id].name;
|
||||
|
||||
//Create notification action
|
||||
var action = function(){
|
||||
@ -90,6 +106,17 @@ ComunicWeb.components.notifications.ui = {
|
||||
|
||||
}
|
||||
|
||||
//For the group membership
|
||||
if(data.on_elem_type == "group_membership"){
|
||||
|
||||
//Open appropriate page
|
||||
if(data.type == "sent_group_membership_request")
|
||||
openPage("groups/"+data.on_elem_id+"/members");
|
||||
else
|
||||
openGroupPage(groups[data.on_elem_id]);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//Create the notification object
|
||||
|
@ -45,6 +45,9 @@ ComunicWeb.components.notifications.utils = {
|
||||
if(!groups.includes(notif.from_container_id) && notif.from_container_type == "group_page")
|
||||
groups.push(notif.from_container_id);
|
||||
|
||||
if(!groups.includes(notif.on_elem_id) && notif.on_elem_type == "group_membership")
|
||||
groups.push(notif.on_elem_id);
|
||||
|
||||
});
|
||||
|
||||
return groups;
|
||||
|
Loading…
Reference in New Issue
Block a user