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>();
|
ArrayList<String> chatList = new ArrayList<String>();
|
||||||
|
|
||||||
if (useNativeAPI) {
|
if (useNativeAPI) {
|
||||||
|
ArrayList<String> chatListReadMessages = new ArrayList<String>();
|
||||||
|
|
||||||
LinphoneChatRoom[] chats = LinphoneManager.getLc().getChatRooms();
|
LinphoneChatRoom[] chats = LinphoneManager.getLc().getChatRooms();
|
||||||
for (LinphoneChatRoom chatroom : chats) {
|
for (LinphoneChatRoom chatroom : chats) {
|
||||||
if (chatroom.getHistory(1).length > 0) {
|
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 {
|
} else {
|
||||||
Cursor c = db.query(TABLE_NAME, null, null, null, "remoteContact", null, "id DESC");
|
Cursor c = db.query(TABLE_NAME, null, null, null, "remoteContact", null, "id DESC");
|
||||||
while (c != null && c.moveToNext()) {
|
while (c != null && c.moveToNext()) {
|
||||||
|
|
Loading…
Reference in a new issue