mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
fix
This commit is contained in:
@@ -75,7 +75,7 @@ export class MessageService {
|
||||
this.msg = msg || ""
|
||||
this.rid = rid
|
||||
this.ts = ts
|
||||
this.u = u || { name: this.usernameToDisplayName(SessionStore.user.RochetChatUser), username: SessionStore.user.RochetChatUser, _id: ""}
|
||||
this.u = u || { name: this.usernameToDisplayName(SessionStore.user.UserName), username: SessionStore.user.UserName, _id: ""}
|
||||
this.t = t
|
||||
this._id = _id
|
||||
this._updatedAt = _updatedAt || new Date().getTime()
|
||||
@@ -287,18 +287,18 @@ console.log(params)
|
||||
|
||||
|
||||
isSenderIsNotMe(ChatMessage) {
|
||||
return SessionStore.user.RochetChatUser != ChatMessage.u.username
|
||||
return SessionStore.user.UserName != ChatMessage.u.username
|
||||
}
|
||||
|
||||
messageOwnerById(id) {
|
||||
return SessionStore.user.RochetChatUser != this.u.username
|
||||
return SessionStore.user.UserName != this.u.username
|
||||
}
|
||||
|
||||
private getChatObj() {
|
||||
return {
|
||||
channels: this.channels,
|
||||
mentions: this.mentions,
|
||||
//msg: this.AESEncrypt.encrypt(this.msg, SessionStore.user.RochetChatUser),
|
||||
//msg: this.AESEncrypt.encrypt(this.msg, SessionStore.user.UserName),
|
||||
msg:this.msg,
|
||||
rid: this.rid,
|
||||
ts: this.ts,
|
||||
@@ -339,7 +339,7 @@ console.log(params)
|
||||
|
||||
decryptMessage() {
|
||||
try {
|
||||
// this.msg = this.AESEncrypt.decrypt(this.msg, SessionStore.user.RochetChatUser)
|
||||
// this.msg = this.AESEncrypt.decrypt(this.msg, SessionStore.user.UserName)
|
||||
} catch (error) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ export class RoomService {
|
||||
|
||||
|
||||
isSenderIsNotMe(ChatMessage) {
|
||||
return SessionStore.user.RochetChatUser != ChatMessage.u.username
|
||||
return SessionStore.user.UserName != ChatMessage.u.username
|
||||
}
|
||||
|
||||
senderId(ChatMessage) {
|
||||
@@ -371,7 +371,7 @@ export class RoomService {
|
||||
if(this.messages[i]?._id == id ) {
|
||||
|
||||
|
||||
if (SessionStore.user.RochetChatUser == this.messages[i]?.u?.username) {
|
||||
if (SessionStore.user.UserName == this.messages[i]?.u?.username) {
|
||||
const allMemberThatIsOffline = this.getAllMemberThatIsOffline()
|
||||
|
||||
DeleteMessageModel.create({
|
||||
@@ -500,7 +500,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
if(lastIsTyping != this.isTyping) {
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.RochetChatUser, 'typing', this.isTyping)
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
}
|
||||
|
||||
|
||||
@@ -509,7 +509,7 @@ export class RoomService {
|
||||
}
|
||||
|
||||
sendFalseTypingReadMessage(method,param: object) {
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.RochetChatUser, 'typing', {method:method, params: param} as falseTypingMethod)
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', {method:method, params: param} as falseTypingMethod)
|
||||
this.setTypingOff()
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@ export class RoomService {
|
||||
|
||||
if(this.isTyping == true) {
|
||||
this.isTyping = false
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.RochetChatUser, 'typing', this.isTyping)
|
||||
this.WsChatService.sendStreamNotifyRoom(this.id, SessionStore.user.UserName, 'typing', this.isTyping)
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ export class WsChatMethodsService {
|
||||
const res = await this.chatService.getMembers(roomId).toPromise();
|
||||
|
||||
const members = res['members'];
|
||||
const users = members.filter(data => data.username != this.sessionStore.user.RochetChatUser);
|
||||
const users = members.filter(data => data.username != this.sessionStore.user.UserName);
|
||||
rooms.result.update[index]['members'] = users
|
||||
|
||||
await this.prepareRoom(roomData);
|
||||
@@ -192,7 +192,7 @@ export class WsChatMethodsService {
|
||||
if (roomData.t === 'p') {
|
||||
const res = await this.chatService.getGroupMembers(roomId).toPromise()
|
||||
const members = res['members'];
|
||||
const users = members.filter(data => data.username != this.sessionStore.user.RochetChatUser);
|
||||
const users = members.filter(data => data.username != this.sessionStore.user.UserName);
|
||||
|
||||
rooms.result.update[index]['members'] = users
|
||||
|
||||
@@ -200,7 +200,7 @@ export class WsChatMethodsService {
|
||||
else {
|
||||
const res = await this.chatService.getChannelMembers(roomId).toPromise()
|
||||
const members = res['members'];
|
||||
const users = members.filter(data => data.username != this.sessionStore.user.RochetChatUser);
|
||||
const users = members.filter(data => data.username != this.sessionStore.user.UserName);
|
||||
|
||||
rooms.result.update[index]['members'] = users
|
||||
|
||||
@@ -366,7 +366,7 @@ export class WsChatMethodsService {
|
||||
|
||||
getReceptorName(roomData) {
|
||||
try {
|
||||
return roomData.usernames.find((e)=> e != SessionStore.user.RochetChatUser)
|
||||
return roomData.usernames.find((e)=> e != SessionStore.user.UserName)
|
||||
} catch(e) {
|
||||
return '*'
|
||||
}
|
||||
@@ -476,7 +476,7 @@ export class WsChatMethodsService {
|
||||
if(this.isIndividual(roomData)) {
|
||||
const names: String[] = roomData.usernames
|
||||
const roomName = names.filter((name, index)=>{
|
||||
return name != SessionStore.user.RochetChatUser
|
||||
return name != SessionStore.user.UserName
|
||||
})[0]
|
||||
|
||||
const firstName = capitalizeTxt(roomName.split('.')[0])
|
||||
@@ -507,7 +507,7 @@ export class WsChatMethodsService {
|
||||
|
||||
let _res = await this.ChatService.getAllUsers().toPromise()
|
||||
|
||||
let users = _res['users'].filter(data => data.username != SessionStore.user.RochetChatUser);
|
||||
let users = _res['users'].filter(data => data.username != SessionStore.user.UserName);
|
||||
|
||||
users = users.sort((a,b) => {
|
||||
if(a.name < b.name) {
|
||||
|
||||
Reference in New Issue
Block a user