Skip to content

Commit

Permalink
if inbound message is for a conversation we are currently looking at,…
Browse files Browse the repository at this point in the history
… mark it as read
  • Loading branch information
liamcottle committed Jun 1, 2024
1 parent 45eeaa5 commit 827a0cd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,19 @@
"lxmf_message": json.lxmf_message,
});

// if inbound message is for a conversation we are currently looking at, mark it as read
if(this.tab === "messages"
&& this.messagesTab === "conversations"
&& json.lxmf_message.source_hash === this.selectedPeer.destination_hash){

// find conversation
const conversation = this.findConversation(this.selectedPeer.destination_hash);
if(conversation){
this.markConversationAsRead(conversation);
}

}

// auto scroll to bottom if we want to
if(this.autoScrollOnNewMessage){
this.scrollMessagesToBottom();
Expand Down Expand Up @@ -2434,6 +2447,11 @@
onIFACSignatureClick: function(ifacSignature) {
alert(ifacSignature);
},
findConversation: function(destinationHash) {
return this.conversations.find((conversation) => {
return conversation.destination_hash === destinationHash;
});
},
},
computed: {
isMobile() {
Expand Down

0 comments on commit 827a0cd

Please sign in to comment.