Add websocket logic server
- Websocket callback binding
- Websocket send message to specific connected socket
GitLab: #53
Change-Id: Ib52db5d99b0bc3ad4d1a775a62fecb9ea3b4d132
diff --git a/server/src/jamid/jamid.ts b/server/src/jamid/jamid.ts
index 27ff0e3..ee91ad4 100644
--- a/server/src/jamid/jamid.ts
+++ b/server/src/jamid/jamid.ts
@@ -138,6 +138,8 @@
// 2. You cannot specify multiple handlers for the same event
// 3. You cannot specify a default handler
this.jamiSwig.init(handlers);
+
+ // TODO: Bind websocket callbacks for webrtc action on Incoming account message
}
stop() {
@@ -189,7 +191,7 @@
sendAccountTextMessage(accountId: string, contactId: string, type: string, message: string) {
const messageStringMap: StringMap = new this.jamiSwig.StringMap();
- messageStringMap.set(type, message);
+ messageStringMap.set(type, JSON.stringify(message));
this.jamiSwig.sendAccountTextMessage(accountId, contactId, messageStringMap);
}
@@ -313,7 +315,7 @@
this.events.onMessageReceived.subscribe((signal) => {
log.debug('Received MessageReceived:', JSON.stringify(signal));
- // TODO: Send message to client using WebSocket
+ // TODO: Send message to client using WS service
});
}
}