From 83cbc2b33b607ee97a770e1cdc2cfc06e3bd15d2 Mon Sep 17 00:00:00 2001 From: lookshe Date: Sun, 6 Mar 2016 17:28:09 +0100 Subject: Implements: FS#142 - Fix Conference notifications --- src/main/java/eu/siacs/conversations/entities/Conversation.java | 8 ++++---- .../java/eu/siacs/conversations/services/NotificationService.java | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/main') diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index c3440b3e..ad7dbc55 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -873,6 +873,9 @@ public class Conversation extends AbstractEntity implements Blockable { } public int unreadCount() { + if (getLongAttribute(Conversation.ATTRIBUTE_MUTED_TILL,0) == Long.MAX_VALUE) { + return 0; + } synchronized (this.messages) { int count = 0; for(int i = this.messages.size() - 1; i >= 0; --i) { @@ -880,10 +883,7 @@ public class Conversation extends AbstractEntity implements Blockable { if (message.isRead()) { return count; } - if (getMode() == Conversation.MODE_SINGLE - || ConversationsPlusPreferences.alwaysNotifyInConference() - || MessageUtil.wasHighlightedOrPrivate(message) - ) { + if (alwaysNotify() || MessageUtil.wasHighlightedOrPrivate(message)) { ++count; } } diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index 467924ef..0f40e8d7 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -64,9 +64,7 @@ public class NotificationService { && !message.isRead() && ConversationsPlusPreferences.showNotification() && !message.getConversation().isMuted() - && (message.getConversation().getMode() == Conversation.MODE_SINGLE - || ConversationsPlusPreferences.alwaysNotifyInConference() - || wasHighlightedOrPrivate(message) + && (message.getConversation().alwaysNotify() || wasHighlightedOrPrivate(message) ); } -- cgit v1.2.3