This commit is contained in:
Peter Maquiran
2022-01-29 19:54:38 +01:00
parent c00b6e444c
commit a2b435b492
@@ -124,26 +124,13 @@ export class WsChatMethodsService {
subscribeToRoom() {
for (const id in this.dm) {
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
console.log('streamRoomMessages', subscription)
})
this.WsChatService.subStreamNotifyRoom(id, 'typing', false)
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{
console.log('streamNotifyRoomDeleteMessage', subscription);
})
this.defaultSubtribe(id)
}
for (const id in this.group) {
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
console.log('streamRoomMessages', subscription)
})
this.WsChatService.subStreamNotifyRoom(id, 'typing', false)
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{
console.log('streamNotifyRoomDeleteMessage', subscription);
})
this.defaultSubtribe(id)
}
this.WsChatService.streamNotifyLogged().then((subscription=>{
console.log('streamRoomMessages', subscription)
}))
@@ -151,20 +138,8 @@ export class WsChatMethodsService {
subscribeToRoomUpdate(id, roomData) {
this.WsChatService.streamRoomMessages(id).then((subscription)=> {
console.log('streamRoomMessages', subscription)
})
this.WsChatService.streamRoomMessages(id).then((subscription) => {
console.log('streamRoomMessages', subscription)
})
this.WsChatService.streamNotifyLogged().then((subscription=> {
console.log('streamRoomMessages', subscription)
}))
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{
console.log('streamNotifyRoomDeleteMessage', subscription);
})
this.WsChatService.subStreamNotifyRoom(id, 'typing', false)
this.defaultSubtribe(id)
this.prepareRoom(roomData);
@@ -172,6 +147,22 @@ export class WsChatMethodsService {
}
/**
* @deprecated things a room need to subscribe on
* @param id
*/
private defaultSubtribe(id) {
this.WsChatService.streamRoomMessages(id).then((subscription)=>{
console.log('streamRoomMessages', subscription)
})
this.WsChatService.subStreamNotifyRoom(id, 'typing', false)
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{
console.log('streamNotifyRoomDeleteMessage', subscription);
})
}
prepareRoom(roomData) {
let room:RoomService;
@@ -214,6 +205,10 @@ export class WsChatMethodsService {
}
}
/**
* @description update user status
* @param id user ID
*/
getUserStatus(id?:string) {
this.WsChatService.getUserStatus((d) => {