mark missed calls as unread (bold) in overview. fixes #3687

This commit is contained in:
Daniel Gultsch 2020-05-03 18:07:00 +02:00
parent 6888f57191
commit 3c3f5d8e6f
2 changed files with 8 additions and 4 deletions

View File

@ -196,13 +196,14 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
public void findUnreadMessages(OnMessageFound onMessageFound) { public void findUnreadMessages(OnMessageFound onMessageFound) {
final ArrayList<Message> results = new ArrayList<>(); final ArrayList<Message> results = new ArrayList<>();
synchronized (this.messages) { synchronized (this.messages) {
for (Message message : this.messages) { for (final Message message : this.messages) {
if (!message.isRead()) { if (message.isRead() || message.getType() == Message.TYPE_RTP_SESSION) {
continue;
}
results.add(message); results.add(message);
} }
} }
} for (final Message result : results) {
for (Message result : results) {
onMessageFound.onMessageFound(result); onMessageFound.onMessageFound(result);
} }
} }

View File

@ -564,9 +564,11 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": timeout reached for ringing"); Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": timeout reached for ringing");
switch (this.state) { switch (this.state) {
case PROPOSED: case PROPOSED:
message.markUnread();
rejectCallFromProposed(); rejectCallFromProposed();
break; break;
case SESSION_INITIALIZED: case SESSION_INITIALIZED:
message.markUnread();
rejectCallFromSessionInitiate(); rejectCallFromSessionInitiate();
break; break;
} }
@ -616,6 +618,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
this.message.setServerMsgId(serverMsgId); this.message.setServerMsgId(serverMsgId);
} }
this.message.setTime(timestamp); this.message.setTime(timestamp);
this.message.markUnread();
writeLogMessageMissed(); writeLogMessageMissed();
finish(); finish();
} else { } else {