Last active
November 1, 2016 11:33
-
-
Save Dima564/61c0f0e71932250f2d608abb28a42fab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun getUnreadCountFromUsers() { | |
val conversations = datasource.getConversations() | |
var count = 0 | |
for (conversation in conversations) { | |
if (conversation.recipientId != null) { | |
for (message in conversation.messages) { | |
if (message.unread) { | |
count += 1 | |
} | |
} | |
} | |
} | |
} | |
private fun getNumberOfUnreadAttachmentsInGroupConversations() { | |
val conversations = datasource.getConversations() | |
var count = 0 | |
for (conversation in conversations) { | |
if (conversation.groupId != null) { | |
for (message in conversation.messages) { | |
if (message.unread && message.type == MessageType.ATTACHMENT) { | |
count += 1 | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment