This commit is contained in:
Peter Maquiran
2023-01-20 14:57:50 +01:00
parent 61d142fa13
commit a203566b3e
24 changed files with 545 additions and 308 deletions
+5 -5
View File
@@ -320,13 +320,13 @@ export class ChatSystemService {
this.defaultSubtribe(id)
}
this.RochetChatConnectorService.streamNotifyLogged().then((subscription=>{
this.RochetChatConnectorService.streamNotifyLogged().then((subscription => {
console.log(subscription)
}))
// this.RochetChatConnectorService.subStreamNotifyUser().then((subscription=>{
// console.log(subscription)
// }))
this.RochetChatConnectorService.subStreamMessageUser().then((subscription => {
console.log(subscription)
}))
}
/**
@@ -622,7 +622,7 @@ export class ChatSystemService {
return !roomData.fname
}
getUsers = () =>{
getUsers = () => {
return this.users
}
@@ -466,6 +466,34 @@ export class RochetChatConnectorService {
}
subStreamMessageUser(param?: any) {
const requestId = uuidv4()
let message = {
msg: "sub",
id: requestId,
name: "stream-notify-user",
params:[
`${SessionStore.user.ChatData.data.userId}/message`,
param
]
}
this.ws.send({message, requestId})
return new Promise((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId ) { // same request send
resolve(message)
return true
}
}})
});
}
receiveStreamNotifyRoom(funx: Function) {
this.ws.registerCallback({