mirror of
https://github.com/liamcottle/reticulum-meshchat.git
synced 2026-12-03 21:30:03 -05:00
if inbound message is for a conversation we are currently looking at, mark it as read
This commit is contained in:
parent
45eeaa5ac8
commit
827a0cda29
1 changed files with 18 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
@ -2434,6 +2447,11 @@
|
|||
onIFACSignatureClick: function(ifacSignature) {
|
||||
alert(ifacSignature);
|
||||
},
|
||||
findConversation: function(destinationHash) {
|
||||
return this.conversations.find((conversation) => {
|
||||
return conversation.destination_hash === destinationHash;
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
isMobile() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue