diff options
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java b/src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java index 397de0b3..56065ea4 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/ConversationFragment.java @@ -68,6 +68,7 @@ import de.thedevstack.conversationsplus.ui.adapter.MessageAdapter; import de.thedevstack.conversationsplus.ui.adapter.MessageAdapter.OnContactPictureClicked; import de.thedevstack.conversationsplus.ui.adapter.MessageAdapter.OnContactPictureLongClicked; import de.thedevstack.conversationsplus.ui.listeners.ConversationSwipeRefreshListener; +import de.thedevstack.conversationsplus.ui.listeners.DeleteFileCallback; import de.thedevstack.conversationsplus.ui.listeners.SimpleUserDecisionCallback; import de.thedevstack.conversationsplus.ui.listeners.UserDecisionListener; import de.thedevstack.conversationsplus.utils.GeoHelper; @@ -588,7 +589,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa public boolean onContextItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.msg_ctx_menu_delete_remote_file: - new SimpleConfirmDialog(getActivity(), "Are you sure?", new DeleteRemoteFileService(selectedMessage)).show(); + new SimpleConfirmDialog(getActivity(), R.string.cplus_are_you_sure, new DeleteRemoteFileService(selectedMessage)).show(); return true; case R.id.msg_ctx_mnu_details: new MessageDetailsDialog(getActivity(), selectedMessage).show(); @@ -615,7 +616,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa retryDecryption(selectedMessage); return true; case R.id.delete_file: - deleteFile(selectedMessage); + new SimpleConfirmDialog(getActivity(), R.string.cplus_are_you_sure, new DeleteFileCallback(selectedMessage)).show(); return true; default: return super.onContextItemSelected(item); @@ -654,13 +655,6 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa } } - private void deleteFile(Message message) { - if (FileBackend.deleteFile(message, activity.xmppConnectionService)) { - message.setTransferable(new TransferablePlaceholder(Transferable.STATUS_DELETED)); - activity.xmppConnectionService.updateConversationUi(); - } - } - private void resendMessage(Message message) { if (message.getType() == Message.TYPE_FILE || message.getType() == Message.TYPE_IMAGE) { DownloadableFile file = FileBackend.getFile(message); |