From b8490bac6500b0ed77571647236e2be56cc5b289 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 13 Aug 2013 15:09:33 +0200 Subject: [PATCH] Updated liblinphone + messages can be deleted one by one using liblinphone storage --- src/org/linphone/ChatFragment.java | 2 +- src/org/linphone/ChatStorage.java | 6 ++++-- submodules/linphone | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/org/linphone/ChatFragment.java b/src/org/linphone/ChatFragment.java index da4a611f5..f4aaf7337 100644 --- a/src/org/linphone/ChatFragment.java +++ b/src/org/linphone/ChatFragment.java @@ -479,7 +479,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC public boolean onContextItemSelected(MenuItem item) { switch (item.getItemId()) { case MENU_DELETE_MESSAGE: - LinphoneActivity.instance().getChatStorage().deleteMessage(item.getGroupId()); + LinphoneActivity.instance().getChatStorage().deleteMessage(chatRoom, item.getGroupId()); invalidate(); break; case MENU_SAVE_PICTURE: diff --git a/src/org/linphone/ChatStorage.java b/src/org/linphone/ChatStorage.java index 90bc8a4bb..15660bbba 100644 --- a/src/org/linphone/ChatStorage.java +++ b/src/org/linphone/ChatStorage.java @@ -354,9 +354,11 @@ public class ChatStorage { return chatList; } - public void deleteMessage(int id) { + public void deleteMessage(LinphoneChatRoom chatroom, int id) { if (useNativeAPI) { - //TODO + LinphoneChatMessage[] history = chatroom.getHistory(); + LinphoneChatMessage message = history[id-1]; + chatroom.deleteMessage(message); } else { db.delete(TABLE_NAME, "id LIKE " + id, null); } diff --git a/submodules/linphone b/submodules/linphone index 679624223..88a0da21c 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 679624223898212549d46757e52646a95b9ab8b8 +Subproject commit 88a0da21c15c3ac031e55b40e219aebee85e82b0