This commit is contained in:
Peter Maquiran
2022-06-08 16:09:40 +01:00
parent b3186c6eed
commit 16ae54d8d1
8 changed files with 114 additions and 156 deletions
@@ -60,7 +60,7 @@ export class WsChatMethodsService {
private ChatMethodsService:ChatMethodsService,
private AESEncrypt: AESEncrypt,
private AttachmentsService:AttachmentsService,
private NetworkServiceService: NetworkServiceService
private NetworkServiceService: NetworkServiceService,
) {
this.loggedUser = authService.ValidatedUserChat['data'];
@@ -106,14 +106,14 @@ export class WsChatMethodsService {
}
async ReLoadChat() {
await this.restoreRooms()
await this.restoreRooms();
await this.getAllRooms();
this.subscribeToRoom()
this.subscribeToRoom();
//
await this.getUser()
this.getUserStatus()
await this.getUser();
this.getUserStatus();
}
clearChat() {
@@ -321,11 +321,11 @@ export class WsChatMethodsService {
members: roomData.members
}
let roomId = this.getRoomId(roomData)
let roomId = this.getRoomId(roomData);
// create room
if(!this.roomExist(roomId)) {
let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService)
let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService, this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService , this.ChatStorageService, this.ChatMethodsService, this.AESEncrypt, this.AttachmentsService, this.NetworkServiceService, this)
room.setData(setData)
room.receiveMessage()
room.getAllUsers = this.getUsers
@@ -365,10 +365,7 @@ export class WsChatMethodsService {
deleteRoom(roomId) {
delete this.group[roomId];
const index = this._group.findIndex((e)=> e.id == roomId);
this._group = this._group.splice(index, 1);
this._group = this._group.filter((e)=> e.id != roomId);
}
roomExist(roomId) {
@@ -463,7 +460,7 @@ export class WsChatMethodsService {
}
addRoomOwner(roomid, userId){
addRoomOwner(roomid, userId) {
return this.WsChatService.addRoomOwner(roomid, userId);
}