mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
add method streamNotifyRoom
This commit is contained in:
@@ -167,6 +167,7 @@ class _RocketChatClientService {
|
|||||||
if(conditions == false) { return new Promise((resolve, reject) => { reject('no error')}); }
|
if(conditions == false) { return new Promise((resolve, reject) => { reject('no error')}); }
|
||||||
|
|
||||||
const requestId = uuidv4()
|
const requestId = uuidv4()
|
||||||
|
|
||||||
var subscribeRequest = {
|
var subscribeRequest = {
|
||||||
"msg": "sub",
|
"msg": "sub",
|
||||||
"id": requestId,
|
"id": requestId,
|
||||||
@@ -189,6 +190,35 @@ class _RocketChatClientService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
streamNotifyRoom(roomId : string) {
|
||||||
|
const conditions = this.attemptRequestQueue({roomId},{methodName: 'subscribe'})
|
||||||
|
if(conditions == false) { return new Promise((resolve, reject) => { reject('no error')}); }
|
||||||
|
|
||||||
|
const requestId = uuidv4()
|
||||||
|
|
||||||
|
let streamNotifyObj = {
|
||||||
|
"msg": "method",
|
||||||
|
"method": "stream-notify-room",
|
||||||
|
"id": requestId,
|
||||||
|
"params": [
|
||||||
|
`null/typing`,
|
||||||
|
"paulo.pinto",
|
||||||
|
true
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
this.ws.send(streamNotifyObj, requestId)
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.ws.registerCallback({type:'Onmessage', requestId, runOnces: true, funx:(message)=>{
|
||||||
|
if(message.id == requestId || message.result.id == requestId) { // same request send
|
||||||
|
resolve('')
|
||||||
|
}
|
||||||
|
}})
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private disconnect = () => {
|
private disconnect = () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user