mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
teste/route
This commit is contained in:
@@ -18,7 +18,13 @@ export class MessageService {
|
||||
msg = ''
|
||||
rid = ''
|
||||
ts = {}
|
||||
u = {}
|
||||
|
||||
u = {
|
||||
name: '',
|
||||
username: '',
|
||||
_id: ""
|
||||
}
|
||||
|
||||
t = ''
|
||||
_id =''
|
||||
_updatedAt
|
||||
@@ -35,6 +41,8 @@ export class MessageService {
|
||||
loadHistory = false
|
||||
duration = ''
|
||||
localReference = null
|
||||
viewed = []
|
||||
received = []
|
||||
|
||||
constructor(private storage: Storage,
|
||||
private NfService: NfService,
|
||||
@@ -78,6 +86,7 @@ export class MessageService {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.calDateDuration()
|
||||
}
|
||||
|
||||
@@ -140,9 +149,9 @@ export class MessageService {
|
||||
|
||||
console.log('message', message)
|
||||
let ChatMessage = message.result
|
||||
|
||||
|
||||
if (environment.chatOffline) {
|
||||
// this.redefinedMessage(ChatMessage)
|
||||
this.redefinedMessage(ChatMessage)
|
||||
this.offline = false
|
||||
}
|
||||
|
||||
@@ -189,5 +198,47 @@ export class MessageService {
|
||||
this.duration = showDateDuration(date || this._updatedAt);
|
||||
}
|
||||
|
||||
private messageReceptor() {
|
||||
return this.u.username != SessionStore.user.RochetChatUser
|
||||
}
|
||||
|
||||
receptorReceive() {
|
||||
|
||||
if(this.messageReceptor()) {
|
||||
let newMessage = {
|
||||
rid: this._id,
|
||||
msg: this.msg,
|
||||
attachments: this.attachments,
|
||||
file: this.file,
|
||||
localReference: this.localReference,
|
||||
viewed: this.viewed.push('123'),
|
||||
received: this.viewed.push('123'),
|
||||
}
|
||||
|
||||
this.WsChatService.updateMessage(newMessage).then(()=>{
|
||||
console.log('newMessage', newMessage)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
receptorView() {
|
||||
if(this.messageReceptor()) {
|
||||
let newMessage = {
|
||||
rid: this._id,
|
||||
msg: this.msg,
|
||||
attachments: this.attachments,
|
||||
file: this.file,
|
||||
localReference: this.localReference,
|
||||
viewed: this.viewed.push('123'),
|
||||
received: this.viewed.push('123'),
|
||||
}
|
||||
|
||||
this.WsChatService.updateMessage(newMessage).then(()=>{
|
||||
console.log('newMessage', newMessage)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user