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:
@@ -264,9 +264,6 @@ export class WsChatMethodsService {
|
||||
* @param roomData
|
||||
*/
|
||||
prepareRoom(roomData) {
|
||||
let room:RoomService;
|
||||
|
||||
room = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService)
|
||||
|
||||
|
||||
const setData = {
|
||||
@@ -277,36 +274,40 @@ export class WsChatMethodsService {
|
||||
lastMessage: this.getRoomLastMessage(roomData),
|
||||
_updatedAt: new Date(roomData._updatedAt['$date'])
|
||||
}
|
||||
|
||||
room.setData(setData)
|
||||
|
||||
room.receiveMessage()
|
||||
room.getAllUsers = this.getUsers
|
||||
room.receiveMessageDelete();
|
||||
room.sortRoomList = this.sortRoomList
|
||||
|
||||
|
||||
let roomId = this.getRoomId(roomData)
|
||||
|
||||
if(this.isIndividual(roomData)) {
|
||||
|
||||
if(!this.dm[roomId]) {
|
||||
if(!this.dm[roomId] && !this.group[roomId]) {
|
||||
let room:RoomService = new RoomService(this.WsChatService, new MessageService(this.storage, this.NfService, this.WsChatService), this.storage, this.platform, this.sqlservice, this.NativeNotificationService, this.sortService, this.ChatService, this.NfService)
|
||||
room.setData(setData)
|
||||
room.receiveMessage()
|
||||
room.getAllUsers = this.getUsers
|
||||
room.receiveMessageDelete();
|
||||
room.sortRoomList = this.sortRoomList
|
||||
|
||||
if(this.isIndividual(roomData)) {
|
||||
|
||||
this.dm[roomId] = room
|
||||
this._dm.push(room)
|
||||
this.dmCount++
|
||||
|
||||
} else {
|
||||
this.dm[roomId].setData(setData)
|
||||
}
|
||||
|
||||
} else {
|
||||
if(this.group[roomId]) {
|
||||
this.group[roomId] = room
|
||||
this._group.push(room)
|
||||
this.groupCount++
|
||||
} else {
|
||||
|
||||
}
|
||||
} else {
|
||||
|
||||
if(this.dm[roomId]) {
|
||||
this.dm[roomId].setData(setData)
|
||||
} else if(this.group[roomId]) {
|
||||
this.group[roomId].setData(setData)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user