diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/entities/Conversation.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index 796b36f9..c3440b3e 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -19,6 +19,8 @@ import java.util.Comparator; import java.util.Iterator; import java.util.List; +import de.thedevstack.conversationsplus.ConversationsPlusPreferences; +import de.thedevstack.conversationsplus.utils.MessageUtil; import eu.siacs.conversations.Config; import eu.siacs.conversations.crypto.axolotl.AxolotlService; import eu.siacs.conversations.xmpp.chatstate.ChatState; @@ -305,14 +307,6 @@ public class Conversation extends AbstractEntity implements Blockable { return this.mFirstMamReference; } - public void setLastClearHistory(long time) { - setAttribute("last_clear_history",String.valueOf(time)); - } - - public long getLastClearHistory() { - return getLongAttribute("last_clear_history", 0); - } - public void setCorrectingMessage(Message correctingMessage) { this.correctingMessage = correctingMessage; } @@ -762,10 +756,6 @@ public class Conversation extends AbstractEntity implements Blockable { } public long getLastMessageTransmitted() { - long last_clear = getLastClearHistory(); - if (last_clear != 0) { - return last_clear; - } synchronized (this.messages) { for(int i = this.messages.size() - 1; i >= 0; --i) { Message message = this.messages.get(i); @@ -886,10 +876,16 @@ public class Conversation extends AbstractEntity implements Blockable { synchronized (this.messages) { int count = 0; for(int i = this.messages.size() - 1; i >= 0; --i) { - if (this.messages.get(i).isRead()) { + Message message = this.messages.get(i); + if (message.isRead()) { return count; } - ++count; + if (getMode() == Conversation.MODE_SINGLE + || ConversationsPlusPreferences.alwaysNotifyInConference() + || MessageUtil.wasHighlightedOrPrivate(message) + ) { + ++count; + } } return count; } |