This commit is contained in:
Peter Maquiran
2022-09-30 16:55:09 +01:00
parent 598a145ad4
commit a226f722aa
3 changed files with 35 additions and 30 deletions
+26 -26
View File
@@ -38,9 +38,6 @@ export class ChatSystemService {
currentRoom: RoomService = null
users: chatUser[] = []
sessionStore = SessionStore
delete = []
constructor(
@@ -180,7 +177,7 @@ export class ChatSystemService {
for (let roomData of rooms.result.update) {
const roomId = this.getRoomId(roomData);
if(roomData.t == 'd') {
let error = false
@@ -260,7 +257,6 @@ export class ChatSystemService {
}
}
await this.storage.set('Rooms', rooms);
setTimeout(() => {
@@ -309,7 +305,7 @@ export class ChatSystemService {
*/
subscribeToRoomUpdate(id, roomData) {
this.defaultSubtribe(id)
this.defaultSubtribe(id);
this.prepareRoom(roomData);
@@ -323,27 +319,30 @@ export class ChatSystemService {
* @param id room id
*/
private defaultSubtribe(id: any) {
const room = this.getRoomById(id);
if(!room.subscribeAttempt) {
room.subscribeAttempt = true;
this.RochetChatConnectorService.streamRoomMessages(id).then((subscription) => {
room.status.receive.message = true;
})
this.RochetChatConnectorService.streamRoomMessages(id).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.message = true;
})
this.RochetChatConnectorService.subStreamNotifyRoom(id, 'typing', false).then((subscription) => {
room.status.receive.typing = true;
//
})
this.RochetChatConnectorService.subStreamNotifyRoom(id, 'readMessage', false).then((subscription) => {
room.status.receive.readMessage = true;
})
this.RochetChatConnectorService.streamNotifyRoomDeleteMessage(id).then((subscription) => {
room.status.receive.deleteMessage = true;
})
}
this.RochetChatConnectorService.subStreamNotifyRoom(id, 'typing', false).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.typing = true;
//
})
this.RochetChatConnectorService.subStreamNotifyRoom(id, 'readMessage', false).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.readMessage = true;
})
this.RochetChatConnectorService.streamNotifyRoomDeleteMessage(id).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.deleteMessage = true;
})
}
private fix_updatedAt(message) {
@@ -396,7 +395,6 @@ export class ChatSystemService {
room.chatServiceDeleteRoom = this.deleteRoom
// create individual room
if(this.isIndividual(roomData)) {
this.dm[roomId] = room
@@ -411,6 +409,8 @@ export class ChatSystemService {
this.groupCount++
}
this.defaultSubtribe(roomId)
} else {
// in this case room is already present, therefor it will only be necessary,
// to redefine
+2
View File
@@ -64,6 +64,8 @@ export class RoomService {
}
}
subscribeAttempt = false
scrollDown = () => { }
/**