add subscribe

This commit is contained in:
Peter Maquiran
2022-01-10 11:29:02 +01:00
parent b5046123de
commit 7a28f2e314
2 changed files with 12 additions and 4 deletions
@@ -128,19 +128,19 @@ class _RocketChatClientService {
}
subscribe() {
subscribe(roomId : string) {
const requestId = uuidv4()
var subscribeRequest = {
"msg": "sub",
"id": requestId,
"name": "stream-notify-room",
"params":[
"room-id/event",
`${roomId}/event`,
false
]
}
this.ws.send(subscribeRequest);
this.ws.send(subscribeRequest);
return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', requestId, runOnces: true, funx:(message)=>{