Updated liblinphone + increased liblinphone chat storage methods covered

This commit is contained in:
Sylvain Berfini 2013-08-12 10:54:25 +02:00
parent ffcb91cee7
commit bc8c5a5b74
2 changed files with 15 additions and 7 deletions

View file

@ -319,7 +319,9 @@ public class ChatStorage {
public void removeDiscussion(String correspondent) {
if (useNativeAPI) {
//TODO
LinphoneChatRoom chatroom = LinphoneManager.getLc().createChatRoom(correspondent);
chatroom.deleteHistory();
chatroom.destroy();
} else {
db.delete(TABLE_NAME, "remoteContact LIKE \"" + correspondent + "\"", null);
}
@ -331,8 +333,10 @@ public class ChatStorage {
if (useNativeAPI) {
LinphoneChatRoom[] chats = LinphoneManager.getLc().getChatRooms();
for (LinphoneChatRoom chatroom : chats) {
if (chatroom.getHistory().length > 0) {
chatList.add(chatroom.getPeerAddress().asStringUriOnly());
}
}
} else {
Cursor c = db.query(TABLE_NAME, null, null, null, "remoteContact", null, "id DESC");
while (c != null && c.moveToNext()) {
@ -373,8 +377,11 @@ public class ChatStorage {
count = c.getCount();
c.close();
} else {
//TODO
count = -1;
count = 0;
LinphoneChatRoom[] chats = LinphoneManager.getLc().getChatRooms();
for (LinphoneChatRoom chatroom : chats) {
count += chatroom.getUnreadMessagesCount();
}
}
return count;
}
@ -386,8 +393,9 @@ public class ChatStorage {
count = c.getCount();
c.close();
} else {
//TODO
count = -1;
LinphoneChatRoom chatroom = LinphoneManager.getLc().createChatRoom(contact);
count = chatroom.getUnreadMessagesCount();
chatroom.destroy();
}
return count;
}

@ -1 +1 @@
Subproject commit 3e2f306e361fce90b05da1cfc7d6c16bc592df69
Subproject commit 8fbe7ee1d47c7957f35ca9268c4072df7921cec1