mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
merge
This commit is contained in:
@@ -44,7 +44,7 @@ export class WsChatMethodsService {
|
||||
private NfService: NfService,
|
||||
private changeProfileService: ChangeProfileService,
|
||||
) {
|
||||
|
||||
|
||||
this.loadChat()
|
||||
|
||||
this.WsChatService.registerCallback({
|
||||
@@ -63,7 +63,7 @@ export class WsChatMethodsService {
|
||||
for (const id in this.dm) {
|
||||
this.dm[id].hasLoadHistory = false
|
||||
}
|
||||
|
||||
|
||||
for (const id in this.group) {
|
||||
this.group[id].hasLoadHistory = false
|
||||
}
|
||||
@@ -79,7 +79,7 @@ export class WsChatMethodsService {
|
||||
this.storage.remove('Rooms');
|
||||
})
|
||||
|
||||
|
||||
|
||||
// this.WsChatService.registerCallback({
|
||||
// type:'Onmessage',
|
||||
// funx:(message) => {
|
||||
@@ -97,7 +97,7 @@ export class WsChatMethodsService {
|
||||
// }
|
||||
// } else if(message.msg =='changed' && message.collection == "stream-notify-room") {
|
||||
// if(message.fields.eventName.includes('deleteMessage')) {
|
||||
// // delete message
|
||||
// // delete message
|
||||
// const DeletedMessageId = message.fields.args[0]._id;
|
||||
|
||||
// setTimeout(()=>{
|
||||
@@ -131,7 +131,7 @@ export class WsChatMethodsService {
|
||||
|
||||
clearChat() {
|
||||
this.dm = {}
|
||||
this.group = {}
|
||||
this.group = {}
|
||||
this._dm = []
|
||||
this._group = []
|
||||
|
||||
@@ -139,7 +139,7 @@ export class WsChatMethodsService {
|
||||
|
||||
this.dmCount = 0;
|
||||
this.groupCount = 0;
|
||||
|
||||
|
||||
this.currentRoom = null
|
||||
this.users = []
|
||||
}
|
||||
@@ -154,11 +154,11 @@ export class WsChatMethodsService {
|
||||
if(this.getDmRoom(roomId)) {
|
||||
this.currentRoom = this.getDmRoom(roomId)
|
||||
} else if(this.getGroupRoom(roomId)) {
|
||||
this.currentRoom = this.getGroupRoom(roomId)
|
||||
this.currentRoom = this.getGroupRoom(roomId)
|
||||
}
|
||||
|
||||
this.currentRoom.open()
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ export class WsChatMethodsService {
|
||||
await rooms.result.update.forEach( async (roomData: room) => {
|
||||
await this.prepareRoom(roomData);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
} catch(e){}
|
||||
@@ -271,7 +271,7 @@ export class WsChatMethodsService {
|
||||
lastMessage: this.getRoomLastMessage(roomData),
|
||||
_updatedAt: new Date(roomData._updatedAt['$date'])
|
||||
}
|
||||
|
||||
|
||||
let roomId = this.getRoomId(roomData)
|
||||
|
||||
// create room
|
||||
@@ -284,19 +284,20 @@ export class WsChatMethodsService {
|
||||
room.sortRoomList = this.sortRoomList
|
||||
|
||||
// create individual room
|
||||
|
||||
if(this.isIndividual(roomData)) {
|
||||
|
||||
|
||||
this.dm[roomId] = room
|
||||
this._dm.push(room)
|
||||
this.dmCount++
|
||||
|
||||
|
||||
} else {
|
||||
// create group room
|
||||
|
||||
this.group[roomId] = room
|
||||
this._group.push(room)
|
||||
this.groupCount++
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
// in this case room is already present, therefor it will only be necessary,
|
||||
@@ -379,12 +380,29 @@ export class WsChatMethodsService {
|
||||
return this.WsChatService.leaveRoom(id);
|
||||
}
|
||||
|
||||
async hideRoom(id) {
|
||||
this._dm.forEach((md, index)=>{
|
||||
if(md.id == id) {
|
||||
this._dm.splice(index, 1)
|
||||
delete this.dm[id]
|
||||
}
|
||||
});
|
||||
|
||||
this._group.forEach((group, index)=>{
|
||||
if(group.id == id) {
|
||||
this._group.splice(index, 1)
|
||||
delete this.group[id]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
hidingRoom(id?) {
|
||||
|
||||
return this.WsChatService.hidingRoom(id).then(()=>{
|
||||
// this.hideRoom(id)
|
||||
})
|
||||
|
||||
return this.WsChatService.hidingRoom(id);
|
||||
}
|
||||
|
||||
addRoomOwner(roomid, userId){
|
||||
|
||||
Reference in New Issue
Block a user