This commit is contained in:
Peter Maquiran
2022-02-10 18:35:33 +01:00
parent dff531799f
commit 78d94a461c
2 changed files with 24 additions and 26 deletions
+23 -25
View File
@@ -95,29 +95,30 @@ export class RoomService {
(_ChatMessage) => {
console.log('recivemessage', _ChatMessage)
let ChatMessage = _ChatMessage.fields.args[0]
ChatMessage = this.fix_updatedAt(ChatMessage)
alert('receive')
const message = this.prepareMessage(ChatMessage)
this.lastMessage = message
this.calDateDuration(ChatMessage._updatedAt)
if (message.t == 'r') {
this.name = message.msg
}
if(this.isSenderIsNotMe(ChatMessage)) {
this.NativeNotificationService.sendNotificationChat({
message: message.msg,
title: this.name
});
}
this.addMessageDB(ChatMessage)
setTimeout(()=>{
this.scrollDown()
}, 50)
let ChatMessage = _ChatMessage.fields.args[0]
ChatMessage = this.fix_updatedAt(ChatMessage)
const message = this.prepareMessage(ChatMessage)
this.lastMessage = message
this.calDateDuration(ChatMessage._updatedAt)
if (message.t == 'r') {
this.name = message.msg
}
if(this.isSenderIsNotMe(ChatMessage)) {
this.NativeNotificationService.sendNotificationChat({
message: message.msg,
title: this.name
});
}
this.addMessageDB(ChatMessage)
setTimeout(()=>{
this.scrollDown()
}, 50)
}, 150)
}
)
@@ -393,7 +394,6 @@ export class RoomService {
if(wewMessage.offline == false) {
this.prepareMessage(ChatMessage)
} else {
alert('create offline')
const offlineMessage = this.prepareMessage(ChatMessage)
offlineMessage.send().then(()=>{
this.updateMessageDB(ChatMessage, ChatMessage.localReference)
@@ -451,7 +451,6 @@ export class RoomService {
wewMessage.loadHistory = this.hasLoadHistory
if(!message._id && environment.chatOffline) {
if(this.hasLoadHistory) alert('create offline')
this.messages.push(wewMessage)
return wewMessage
@@ -467,7 +466,6 @@ export class RoomService {
})
if (save && !found) {
if(this.hasLoadHistory) alert('not found')
this.messages.push(wewMessage)
}