mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix chat eror
This commit is contained in:
@@ -12,7 +12,7 @@ import { AESEncrypt } from '../aesencrypt.service'
|
||||
import { HttpEventType } from '@angular/common/http';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { NetworkServiceService , ConnectionStatus} from 'src/app/services/network-service.service';
|
||||
|
||||
import { ChatSystemService } from './chat-system.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -67,7 +67,8 @@ export class MessageService {
|
||||
private ChatMethodsService: ChatMethodsService,
|
||||
private AESEncrypt: AESEncrypt,
|
||||
private AttachmentsService: AttachmentsService,
|
||||
private NetworkServiceService: NetworkServiceService) {
|
||||
private NetworkServiceService: NetworkServiceService,
|
||||
private ChatSystemService: ChatSystemService) {
|
||||
}
|
||||
|
||||
setData({customFields = {}, channels, mentions, msg ,rid ,ts, u, t, _id, id, _updatedAt, file, attachments, temporaryData, localReference , viewed = [], received = [], delate = false, delateRequest =false, from }:Message) {
|
||||
@@ -119,6 +120,17 @@ export class MessageService {
|
||||
}
|
||||
}
|
||||
|
||||
if(!this.u.name && this.u.username) {
|
||||
const user = this.ChatSystemService.users.find((u)=> u.username == this.u.username)
|
||||
if(user) {
|
||||
this.u.name = user.name
|
||||
} else if( this.u.username == SessionStore.user.UserName) {
|
||||
this.u.name = SessionStore.user.FullName
|
||||
} else {
|
||||
// console.log(user.username, SessionStore.user.UserName)
|
||||
}
|
||||
}
|
||||
|
||||
this.calDateDuration()
|
||||
}
|
||||
|
||||
@@ -203,7 +215,6 @@ export class MessageService {
|
||||
// console.log('online send')
|
||||
this.RochetChatConnectorService.send(params).then(
|
||||
(ChatMessage: any) => {
|
||||
console.log('response')
|
||||
ChatMessage = ChatMessage.message.result
|
||||
|
||||
this.messageSend = true
|
||||
|
||||
Reference in New Issue
Block a user