This commit is contained in:
Peter Maquiran
2022-09-26 18:27:08 +01:00
parent de3a4583dc
commit b6b41549f7
2 changed files with 6 additions and 21 deletions
@@ -176,7 +176,6 @@ export class WsChatMethodsService {
await this.storage.remove('Rooms');
} catch(e) {}
console.log(rooms,'=========!+!+!++!+=====')
let index = 0
if(rooms?.result?.update) {
@@ -220,7 +219,6 @@ export class WsChatMethodsService {
await this.storage.set('Rooms', rooms);
console.log('done get rooms')
setTimeout(() => {
@@ -249,7 +247,6 @@ export class WsChatMethodsService {
*/
subscribeToRoom() {
console.log('defaultSubtribe', this.dm)
for (const id in this.dm) {
this.defaultSubtribe(id)
@@ -259,8 +256,6 @@ export class WsChatMethodsService {
this.defaultSubtribe(id)
}
console.log("Done subcribe");
this.WsChatService.streamNotifyLogged().then((subscription=>{
}))
@@ -287,33 +282,30 @@ export class WsChatMethodsService {
* @param id room id
*/
private defaultSubtribe(id: any) {
console.log(id, this._dm);
this.WsChatService.streamRoomMessages(id).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.message = true;
console.log(subscription, "subscription");
})
this.WsChatService.subStreamNotifyRoom(id, 'typing', false).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.typing = true;
console.log(subscription, "subStreamNotifyRoom");
//
})
this.WsChatService.subStreamNotifyRoom(id, 'readMessage', false).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.readMessage = true;
console.log(subscription, "subStreamNotifyRoom");
// console.log(subscription, "subStreamNotifyRoom");
//
})
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.deleteMessage = true;
console.log(subscription);
// console.log(subscription);
//
})
}