Display chat conversations with unread messages first
This commit is contained in:
parent
8b60cc4faf
commit
5b32131afe
1 changed files with 9 additions and 1 deletions
|
@ -378,12 +378,20 @@ public class ChatStorage {
|
|||
ArrayList<String> chatList = new ArrayList<String>();
|
||||
|
||||
if (useNativeAPI) {
|
||||
ArrayList<String> chatListReadMessages = new ArrayList<String>();
|
||||
|
||||
LinphoneChatRoom[] chats = LinphoneManager.getLc().getChatRooms();
|
||||
for (LinphoneChatRoom chatroom : chats) {
|
||||
if (chatroom.getHistory(1).length > 0) {
|
||||
chatList.add(chatroom.getPeerAddress().asStringUriOnly());
|
||||
if (chatroom.getUnreadMessagesCount() > 0) {
|
||||
chatList.add(chatroom.getPeerAddress().asStringUriOnly());
|
||||
} else {
|
||||
chatListReadMessages.add(chatroom.getPeerAddress().asStringUriOnly());
|
||||
}
|
||||
}
|
||||
}
|
||||
chatList.addAll(chatListReadMessages);
|
||||
|
||||
} else {
|
||||
Cursor c = db.query(TABLE_NAME, null, null, null, "remoteContact", null, "id DESC");
|
||||
while (c != null && c.moveToNext()) {
|
||||
|
|
Loading…
Reference in a new issue