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:
@@ -69,6 +69,39 @@ export class WsChatMethodsService {
|
||||
}
|
||||
})
|
||||
|
||||
// console.log("ROOMS" + JSON.stringify(rooms))
|
||||
// this.WsChatService.registerCallback({
|
||||
// type:'Onmessage',
|
||||
// funx:(message) => {
|
||||
|
||||
// if(message.msg =='changed' && message.collection == "stream-room-messages") {
|
||||
// if(message.fields.args[0].rid) {
|
||||
// // new message
|
||||
// const ChatMessage = message.fields.args[0]
|
||||
// const messageId = ChatMessage.rid
|
||||
|
||||
// setTimeout(()=>{
|
||||
// this.sortRoomList()
|
||||
// }, 100)
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
// if(message.msg =='changed' && message.collection == "stream-notify-room") {
|
||||
// if(message.fields.eventName.includes('deleteMessage')){
|
||||
// // delete message
|
||||
// const DeletedMessageId = message.fields.args[0]._id;
|
||||
|
||||
// setTimeout(()=>{
|
||||
// this.sortRoomList()
|
||||
// }, 100)
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
|
||||
|
||||
}
|
||||
|
||||
getRoomFromDb() {
|
||||
@@ -132,32 +165,6 @@ export class WsChatMethodsService {
|
||||
this._dm = []
|
||||
this._group = []
|
||||
|
||||
// console.log("ROOMS" + JSON.stringify(rooms))
|
||||
this.WsChatService.registerCallback({
|
||||
type:'Onmessage',
|
||||
funx:(message)=>{
|
||||
|
||||
if(message.msg =='changed' && message.collection == "stream-room-messages") {
|
||||
if(message.fields.args[0].rid) {
|
||||
|
||||
setTimeout(()=>{
|
||||
this.sortRoomList()
|
||||
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
|
||||
if(message.msg =='changed' && message.collection == "stream-notify-room") {
|
||||
if(message.fields.eventName.includes('deleteMessage')){
|
||||
setTimeout(()=>{
|
||||
|
||||
this.sortRoomList()
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
await rooms.result.update.forEach( async (roomData: room) => {
|
||||
await this.prepareRoom(roomData);
|
||||
});
|
||||
@@ -276,20 +283,20 @@ export class WsChatMethodsService {
|
||||
*/
|
||||
private getUserStatus(id?:string) {
|
||||
|
||||
this.WsChatService.getUserStatus((d) => {
|
||||
// this.WsChatService.getUserStatus((d) => {
|
||||
|
||||
const username = d.fields.args[0][1]
|
||||
const statusNum = d.fields.args[0][2]
|
||||
// const username = d.fields.args[0][1]
|
||||
// const statusNum = d.fields.args[0][2]
|
||||
|
||||
const statusText = this.statusNumberToText(statusNum)
|
||||
// const statusText = this.statusNumberToText(statusNum)
|
||||
|
||||
const user = this.getUserByName(username)
|
||||
// const user = this.getUserByName(username)
|
||||
|
||||
if(user) {
|
||||
user.status = statusText
|
||||
}
|
||||
// if(user) {
|
||||
// user.status = statusText
|
||||
// }
|
||||
|
||||
})
|
||||
// })
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user