mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-12-27 22:18:52 +00:00
Send a message through websocket for updated messages
This commit is contained in:
parent
f8e8bc8322
commit
a4dcf49d74
@ -143,7 +143,18 @@ export class UserWebSocketActions {
|
||||
* @param msgID Message ID
|
||||
*/
|
||||
public static async UpdatedConversationMessage(msgID: number) {
|
||||
console.info("Update conversation message " + msgID);
|
||||
const msg = await ConversationsHelper.GetSingleMessage(msgID);
|
||||
|
||||
for(const client of UserWebSocketController.active_clients.filter(
|
||||
e => e.registeredConversations.has(msg.convID))) {
|
||||
|
||||
UserWebSocketController.SendToClient(client, new WsMessage({
|
||||
id: "",
|
||||
title: "updated_conv_message",
|
||||
data: ConversationsController.ConversationMessageToAPI(msg)
|
||||
}))
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -317,7 +317,7 @@ export class ConversationsHelper {
|
||||
* @param messageID The ID of the message to get
|
||||
* @throws If the message was not found
|
||||
*/
|
||||
private static async GetSingleMessage(messageID: number) : Promise<ConversationMessage> {
|
||||
public static async GetSingleMessage(messageID: number) : Promise<ConversationMessage> {
|
||||
const row = await DatabaseHelper.QueryRow({
|
||||
table: MESSAGES_TABLE,
|
||||
where: {
|
||||
|
Loading…
Reference in New Issue
Block a user