diff --git a/back/src/RoomManager.ts b/back/src/RoomManager.ts index 8dbde018..322c9b46 100644 --- a/back/src/RoomManager.ts +++ b/back/src/RoomManager.ts @@ -251,7 +251,12 @@ const roomManager: IRoomManagerServer = { }, sendAdminMessage(call: ServerUnaryCall, callback: sendUnaryData): void { socketManager - .sendAdminMessage(call.request.getRoomid(), call.request.getRecipientuuid(), call.request.getMessage()) + .sendAdminMessage( + call.request.getRoomid(), + call.request.getRecipientuuid(), + call.request.getMessage(), + call.request.getType() + ) .catch((e) => console.error(e)); callback(null, new EmptyMessage()); diff --git a/back/src/Services/SocketManager.ts b/back/src/Services/SocketManager.ts index 8989df75..a5f53f4c 100644 --- a/back/src/Services/SocketManager.ts +++ b/back/src/Services/SocketManager.ts @@ -691,7 +691,7 @@ export class SocketManager { } } - public async sendAdminMessage(roomId: string, recipientUuid: string, message: string): Promise { + public async sendAdminMessage(roomId: string, recipientUuid: string, message: string, type: string): Promise { const room = await this.roomsPromises.get(roomId); if (!room) { console.error( @@ -715,7 +715,7 @@ export class SocketManager { for (const recipient of recipients) { const sendUserMessage = new SendUserMessage(); sendUserMessage.setMessage(message); - sendUserMessage.setType("ban"); //todo: is the type correct? + sendUserMessage.setType(type); const serverToClientMessage = new ServerToClientMessage(); serverToClientMessage.setSendusermessage(sendUserMessage);