This commit is contained in:
Peter Maquiran
2022-03-27 15:33:00 +01:00
7 changed files with 41 additions and 34 deletions
+13 -13
View File
@@ -24,10 +24,10 @@ export class MessageService {
msg = ''
rid = ''
ts = {}
u = {
name: '',
username: '',
u = {
name: '',
username: '',
_id: ""
}
@@ -88,10 +88,10 @@ export class MessageService {
} else {
this.attachments = attachments
}
this.viewed = [...new Set([...viewed,...this.viewed])];
this.received = [...new Set([...received,...this.received])];
if(!this.ts) {
this.offline = true
this.messageSend = false
@@ -131,7 +131,7 @@ export class MessageService {
if(!this.hasFile) {
const params = {roomId:this.rid, msg:this.msg, localReference: this.localReference}
await this.sendRequest(params)
} else {
@@ -171,7 +171,7 @@ export class MessageService {
return new Promise((resolve, reject)=>{
reject(false)
})
}
}
@@ -206,7 +206,7 @@ export class MessageService {
async redefinedMessage(ChatMessage , update = true) {
ChatMessage = this.NfService.fix_updatedAt(ChatMessage)
const message = this.getChatObj()
ChatMessage = Object.assign(message, ChatMessage)
@@ -241,7 +241,7 @@ export class MessageService {
title_link_download: this.attachments[0].title_link_download,
ts: this.attachments[0].ts
}
console.log(this.attachments)
// save the changes to the storage
this.save()
@@ -261,7 +261,7 @@ export class MessageService {
}
async delateDB() {
// alert('delete data')
const message = await MessageModel.get({_id: this._id})
await message.delete()
@@ -281,8 +281,8 @@ export class MessageService {
return {
channels: this.channels,
mentions: this.mentions,
//msg: this.AESEncrypt.encrypt(this.msg, SessionStore.user.RochetChatUser),
msg:this.msg,
//msg: this.AESEncrypt.encrypt(this.msg, SessionStore.user.RochetChatUser),
msg:this.msg,
rid: this.rid,
ts: this.ts,
u: this.u,