Merge pull request #1658 from albanbruder/fix-admin-message
Fix: Use specified type in admin message
This commit is contained in:
commit
e220bf56db
@ -251,7 +251,12 @@ const roomManager: IRoomManagerServer = {
|
|||||||
},
|
},
|
||||||
sendAdminMessage(call: ServerUnaryCall<AdminMessage>, callback: sendUnaryData<EmptyMessage>): void {
|
sendAdminMessage(call: ServerUnaryCall<AdminMessage>, callback: sendUnaryData<EmptyMessage>): void {
|
||||||
socketManager
|
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));
|
.catch((e) => console.error(e));
|
||||||
|
|
||||||
callback(null, new EmptyMessage());
|
callback(null, new EmptyMessage());
|
||||||
|
@ -691,7 +691,7 @@ export class SocketManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async sendAdminMessage(roomId: string, recipientUuid: string, message: string): Promise<void> {
|
public async sendAdminMessage(roomId: string, recipientUuid: string, message: string, type: string): Promise<void> {
|
||||||
const room = await this.roomsPromises.get(roomId);
|
const room = await this.roomsPromises.get(roomId);
|
||||||
if (!room) {
|
if (!room) {
|
||||||
console.error(
|
console.error(
|
||||||
@ -715,7 +715,7 @@ export class SocketManager {
|
|||||||
for (const recipient of recipients) {
|
for (const recipient of recipients) {
|
||||||
const sendUserMessage = new SendUserMessage();
|
const sendUserMessage = new SendUserMessage();
|
||||||
sendUserMessage.setMessage(message);
|
sendUserMessage.setMessage(message);
|
||||||
sendUserMessage.setType("ban"); //todo: is the type correct?
|
sendUserMessage.setType(type);
|
||||||
|
|
||||||
const serverToClientMessage = new ServerToClientMessage();
|
const serverToClientMessage = new ServerToClientMessage();
|
||||||
serverToClientMessage.setSendusermessage(sendUserMessage);
|
serverToClientMessage.setSendusermessage(sendUserMessage);
|
||||||
|
Loading…
Reference in New Issue
Block a user