From 3c3f5d8e6ffa5c7be8995ffdcd4f66ec5cd406a7 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 3 May 2020 18:07:00 +0200 Subject: [PATCH] mark missed calls as unread (bold) in overview. fixes #3687 --- .../eu/siacs/conversations/entities/Conversation.java | 9 +++++---- .../conversations/xmpp/jingle/JingleRtpConnection.java | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index 9acd2810d..55129dd65 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -196,13 +196,14 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl public void findUnreadMessages(OnMessageFound onMessageFound) { final ArrayList results = new ArrayList<>(); synchronized (this.messages) { - for (Message message : this.messages) { - if (!message.isRead()) { - results.add(message); + for (final Message message : this.messages) { + if (message.isRead() || message.getType() == Message.TYPE_RTP_SESSION) { + continue; } + results.add(message); } } - for (Message result : results) { + for (final Message result : results) { onMessageFound.onMessageFound(result); } } diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java index 5a8c7d6d2..f74c738b8 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -564,9 +564,11 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": timeout reached for ringing"); switch (this.state) { case PROPOSED: + message.markUnread(); rejectCallFromProposed(); break; case SESSION_INITIALIZED: + message.markUnread(); rejectCallFromSessionInitiate(); break; } @@ -616,6 +618,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web this.message.setServerMsgId(serverMsgId); } this.message.setTime(timestamp); + this.message.markUnread(); writeLogMessageMissed(); finish(); } else {