aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services
diff options
context:
space:
mode:
authorDaniel Gultsch <inputmice@siacs.eu>2015-03-02 11:53:15 +0100
committerDaniel Gultsch <inputmice@siacs.eu>2015-03-02 11:53:15 +0100
commitac577fe4fd36e56ff492d588af5bb427b98d915e (patch)
tree6a7ee4578d5ab57089a1114c1ba8c6315a40e7c3 /src/main/java/eu/siacs/conversations/services
parentff86fa604903cd77fe26860be0cc256b5d1e04eb (diff)
added methods to count number of unread messages
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services')
-rw-r--r--src/main/java/eu/siacs/conversations/services/XmppConnectionService.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
index a67378de8..f6e479c70 100644
--- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java
@@ -2080,6 +2080,14 @@ public class XmppConnectionService extends Service implements OnPhoneContactsLoa
return getPreferences().getBoolean("indicate_received", false);
}
+ public int unreadCount() {
+ int count = 0;
+ for(Conversation conversation : getConversations()) {
+ count += conversation.unreadCount();
+ }
+ return count;
+ }
+
public void updateConversationUi() {
if (mOnConversationUpdate != null) {
mOnConversationUpdate.onConversationUpdate();