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
+23 -23
View File
@@ -38,9 +38,6 @@ export class ChatSystemService {
currentRoom: RoomService = null
users: chatUser[] = []
sessionStore = SessionStore
delete = []
constructor(
@@ -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);
@@ -324,26 +320,29 @@ export class ChatSystemService {
*/
private defaultSubtribe(id: any) {
this.RochetChatConnectorService.streamRoomMessages(id).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.message = true;
})
const room = this.getRoomById(id);
this.RochetChatConnectorService.subStreamNotifyRoom(id, 'typing', false).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.typing = true;
//
})
if(!room.subscribeAttempt) {
room.subscribeAttempt = true;
this.RochetChatConnectorService.subStreamNotifyRoom(id, 'readMessage', false).then((subscription) => {
const room = this.getRoomById(id);
room.status.receive.readMessage = true;
})
this.RochetChatConnectorService.streamRoomMessages(id).then((subscription) => {
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.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 = () => { }
/**
@@ -51,10 +51,13 @@ export class NewGroupPage implements OnInit{
ngOnInit() {
this.task = this.dataService.get("task");
this.groupName = this.task.Folio;
this.documents = this.dataService.get("documents");
console.log(this.dataService.data);
this.dataService.set("newGroup", false);
if(this.task) {
this.groupName = this.task.Folio;
this.documents = this.dataService.get("documents");
console.log(this.dataService.data);
this.dataService.set("newGroup", false);
}
}
_ionChange(event) {