allow sending on multiple channels

This commit is contained in:
marlonerler
2024-07-05 14:07:38 +02:00
parent fbb36c6920
commit 81a732f40d
+5 -2
View File
@@ -64,8 +64,11 @@ export function processMessage(ws: WS, messageString: string): void {
} }
); );
guardStringNotEmpty(messageObject.messageChannel, (messageChannel) => { guardStringNotEmpty(messageObject.messageChannel, (messageChannel) => {
if (!messageObject.messageBody) return; const body = messageObject.messageBody;
sendMessage(messageChannel, messageObject.messageBody); if (body == undefined) return;
const channels = messageChannel.split("/");
channels.forEach((channel) => sendMessage(channel, body));
}); });
} }