This commit is contained in:
Eudes Inácio
2022-02-09 15:27:35 +01:00
2 changed files with 16 additions and 7 deletions
+13 -4
View File
@@ -92,7 +92,7 @@ export class RoomService {
"stream-room-messages", "stream-room-messages",
(ChatMessage) => { (ChatMessage) => {
setTimeout(()=>{ setTimeout(() => {
ChatMessage = ChatMessage.fields.args[0] ChatMessage = ChatMessage.fields.args[0]
ChatMessage = this.fix_updatedAt(ChatMessage) ChatMessage = this.fix_updatedAt(ChatMessage)
@@ -103,7 +103,6 @@ export class RoomService {
}) })
if(!messageIsFound) { if(!messageIsFound) {
console.log('messageIsFound', messageIsFound)
const message = this.prepareMessage(ChatMessage) const message = this.prepareMessage(ChatMessage)
this.lastMessage = message this.lastMessage = message
@@ -119,9 +118,11 @@ export class RoomService {
title: this.name title: this.name
}); });
if(this.isSenderIsNotMe(ChatMessage)) {
this.addMessageDB(ChatMessage) this.addMessageDB(ChatMessage)
} else { }
console.log('have')
} }
}, 150) }, 150)
@@ -360,8 +361,16 @@ export class RoomService {
await chatHistory.result.messages.reverse().forEach( async (message) => { await chatHistory.result.messages.reverse().forEach( async (message) => {
this.prepareMessage(message) this.prepareMessage(message)
const wewMessage = this.prepareMessage(message, false)
if(wewMessage.offline == false) {
this.prepareMessage(message)
}
}); });
this.storage.set('chatmsg' + this.id, chatHistory)
}) })
setTimeout(() => { setTimeout(() => {