Updated liblinphone + increased liblinphone chat storage methods covered
This commit is contained in:
parent
ffcb91cee7
commit
bc8c5a5b74
2 changed files with 15 additions and 7 deletions
|
@ -319,7 +319,9 @@ public class ChatStorage {
|
||||||
|
|
||||||
public void removeDiscussion(String correspondent) {
|
public void removeDiscussion(String correspondent) {
|
||||||
if (useNativeAPI) {
|
if (useNativeAPI) {
|
||||||
//TODO
|
LinphoneChatRoom chatroom = LinphoneManager.getLc().createChatRoom(correspondent);
|
||||||
|
chatroom.deleteHistory();
|
||||||
|
chatroom.destroy();
|
||||||
} else {
|
} else {
|
||||||
db.delete(TABLE_NAME, "remoteContact LIKE \"" + correspondent + "\"", null);
|
db.delete(TABLE_NAME, "remoteContact LIKE \"" + correspondent + "\"", null);
|
||||||
}
|
}
|
||||||
|
@ -331,8 +333,10 @@ public class ChatStorage {
|
||||||
if (useNativeAPI) {
|
if (useNativeAPI) {
|
||||||
LinphoneChatRoom[] chats = LinphoneManager.getLc().getChatRooms();
|
LinphoneChatRoom[] chats = LinphoneManager.getLc().getChatRooms();
|
||||||
for (LinphoneChatRoom chatroom : chats) {
|
for (LinphoneChatRoom chatroom : chats) {
|
||||||
|
if (chatroom.getHistory().length > 0) {
|
||||||
chatList.add(chatroom.getPeerAddress().asStringUriOnly());
|
chatList.add(chatroom.getPeerAddress().asStringUriOnly());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} 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()) {
|
||||||
|
@ -373,8 +377,11 @@ public class ChatStorage {
|
||||||
count = c.getCount();
|
count = c.getCount();
|
||||||
c.close();
|
c.close();
|
||||||
} else {
|
} else {
|
||||||
//TODO
|
count = 0;
|
||||||
count = -1;
|
LinphoneChatRoom[] chats = LinphoneManager.getLc().getChatRooms();
|
||||||
|
for (LinphoneChatRoom chatroom : chats) {
|
||||||
|
count += chatroom.getUnreadMessagesCount();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
@ -386,8 +393,9 @@ public class ChatStorage {
|
||||||
count = c.getCount();
|
count = c.getCount();
|
||||||
c.close();
|
c.close();
|
||||||
} else {
|
} else {
|
||||||
//TODO
|
LinphoneChatRoom chatroom = LinphoneManager.getLc().createChatRoom(contact);
|
||||||
count = -1;
|
count = chatroom.getUnreadMessagesCount();
|
||||||
|
chatroom.destroy();
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 3e2f306e361fce90b05da1cfc7d6c16bc592df69
|
Subproject commit 8fbe7ee1d47c7957f35ca9268c4072df7921cec1
|
Loading…
Reference in a new issue