1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-29 16:56:28 +00:00

Send a notification when responding to friensdhip request

This commit is contained in:
Pierre HUBERT 2021-01-24 18:17:32 +01:00
parent 919f4184b7
commit c7c651e6fe

View File

@ -119,7 +119,15 @@ pub fn respond_request(r: &mut HttpRequestHandler) -> RequestResult {
friends_helper::respond_request(r.user_id_ref()?, &friend_id, accept)?; friends_helper::respond_request(r.user_id_ref()?, &friend_id, accept)?;
// TODO : create a notification // Create a notification
notifications_helper::create_friends_notification(
r.user_id_ref()?,
&friend_id,
match accept {
true => NotifEventType::ACCEPTED_FRIEND_REQUEST,
false => NotifEventType::REJECTED_FRIEND_REQUEST
},
)?;
r.set_response("Response to the friendship request successfully saved!") r.set_response("Response to the friendship request successfully saved!")
} }