1
0
mirror of https://gitlab.com/comunic/comunicapiv2 synced 2025-06-24 02:13:28 +00:00

Propagate the deletion of a conversation message

This commit is contained in:
2020-04-03 08:56:39 +02:00
parent 5503d1af0b
commit 2465b0c1ac
3 changed files with 26 additions and 1 deletions

View File

@ -144,6 +144,19 @@ export class UserWebSocketActions {
)
}
/**
* Propagate the deletion of a conversation message
*
* @param msg Message ID
*/
public static async DeletedConversationMessage(msg: ConversationMessage) {
await UserWebSocketController.SendToSpecifcClients(
(e) => e.registeredConversations.has(msg.convID),
() => WsMessage.NoIDMessage("deleted_conv_message", ConversationsController.ConversationMessageToAPI(msg))
)
}
/**
* Propagate the creation of a new comment
*
@ -192,9 +205,10 @@ EventsHelper.Listen("updated_number_notifications", async (e) => await UserWebSo
// When we get a new number of unread conversations
EventsHelper.Listen("updated_number_unread_conversations", async (e) => await UserWebSocketActions.SendNewUnreadConversationsCount(e.usersID));
// When a new message is sent / updated
// When a new message is sent / updated / deleted
EventsHelper.Listen("sent_conversation_message", async (e) => await UserWebSocketActions.SentNewConversationMessage(e.msg));
EventsHelper.Listen("conv_message_updated", async (e) => await UserWebSocketActions.UpdatedConversationMessage(e.msgId));
EventsHelper.Listen("conv_message_deleted", async (e) => await UserWebSocketActions.DeletedConversationMessage(e.message));
// When a comment is created / updated / deleted
EventsHelper.Listen("comment_created", async (e) => await UserWebSocketActions.CreatedNewComment(e.comment))