update comments

This commit is contained in:
marlon-erler
2024-07-08 19:27:49 +02:00
parent fb255e510c
commit f9f6d70a61
+4 -3
View File
@@ -144,6 +144,7 @@ export function processMessage(
messageString: string,
config: typeof defaultConfig
): void {
// MESSAGE ID
// check id
const messageObject: WebSocketMessage = parseMessage(messageString);
if (!messageObject.uuid) {
@@ -156,7 +157,7 @@ export function processMessage(
// remember message
knownMessageIds.add(messageObject.uuid);
// subscriptions
// SUBSCRIPTIONS
doIfIsString(messageObject.subscribeChannel, (subscribeChannel) => {
trackSubscription(ws, subscribeChannel);
});
@@ -164,13 +165,13 @@ export function processMessage(
forgetSubscription(ws, unsubscribeChannel);
});
// message
// MESSAGE
doIfIsString(messageObject.messageChannel, (messageChannel) => {
if (messageObject.messageBody == undefined) return;
sendMessage(messageChannel, messageObject.messageBody, messageObject.uuid!);
});
// other server
// OTHER SERVER
if (messageObject.requestingServerConnection == true) {
clientsConnected.delete(ws);
serversConnectedAsClient.add(ws);