mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user