From 5f70c32b960fd3f10f0a3e8bff5ab00034d28d07 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 24 Jan 2021 18:29:19 +0100 Subject: [PATCH] Create notification when responding to group membership invitation --- src/controllers/groups_controller.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/groups_controller.rs b/src/controllers/groups_controller.rs index b8229dc..7e988aa 100644 --- a/src/controllers/groups_controller.rs +++ b/src/controllers/groups_controller.rs @@ -210,7 +210,11 @@ pub fn respond_invitation(r: &mut HttpRequestHandler) -> RequestResult { groups_helper::set_following(&group_id, &r.user_id()?, true)?; } - // TODO : Create a notification + // Create a notification + notifications_helper::create_group_membership_notification(r.user_id_ref()?, None, &group_id, match accept { + true => NotifEventType::ACCEPTED_GROUP_MEMBERSHIP_INVITATION, + false => NotifEventType::REJECTED_GROUP_MEMBERSHIP_INVITATION + })?; r.success("Response to the invitation was successfully saved!") }