This commit is contained in:
Peter Maquiran
2022-01-10 13:31:15 +01:00
parent d4470e0b80
commit b82239741b
6 changed files with 57 additions and 4 deletions
@@ -2,6 +2,9 @@ import { Injectable } from '@angular/core';
import { v4 as uuidv4 } from 'uuid'
import { wsCallbacksParams, msgQueue } from 'src/app/models/rochet-chat-cliente-service'
/**
* Use this class to interact with rocketchat realtime API
*/
class _RocketChatClientService {
private hasPing = false
@@ -102,7 +105,7 @@ class _RocketChatClientService {
}
logout(){}
logout() {}
send(roomId, message) {
@@ -182,7 +185,7 @@ class _RocketChatClientService {
return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', requestId, runOnces: true, funx:(message)=>{
if(message.result.id == requestId) { // same request send
if(message.msg == 'ready' || message.subs[0] == requestId) { // same request send
resolve(message)
}
}})