aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui
diff options
context:
space:
mode:
authorfiaxh <github@lightrise.org>2016-02-23 15:30:41 +0100
committerfiaxh <github@lightrise.org>2016-02-23 16:05:42 +0100
commit894b5892a977c6b7ac52f07e00f452a44bdc1168 (patch)
tree63295a84fffd705f4b41b74363a95824f307ba6d /src/main/java/eu/siacs/conversations/ui
parent689ded160718b5c73e118abe531530082b322636 (diff)
Retry decryption from message menu
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index d5c77490..15e4b985 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -523,6 +523,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
activity.getMenuInflater().inflate(R.menu.message_context, menu);
menu.setHeaderTitle(R.string.message_options);
MenuItem copyText = menu.findItem(R.id.copy_text);
+ MenuItem retryDecryption = menu.findItem(R.id.retry_decryption);
MenuItem correctMessage = menu.findItem(R.id.correct_message);
MenuItem shareWith = menu.findItem(R.id.share_with);
MenuItem sendAgain = menu.findItem(R.id.send_again);
@@ -535,6 +536,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
&& m.treatAsDownloadable() != Message.Decision.MUST) {
copyText.setVisible(true);
}
+ if (m.getEncryption() == Message.ENCRYPTION_DECRYPTION_FAILED) {
+ retryDecryption.setVisible(true);
+ }
if (relevantForCorrection.getType() == Message.TYPE_TEXT
&& relevantForCorrection.isLastCorrectableMessage()) {
correctMessage.setVisible(true);
@@ -590,6 +594,9 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
case R.id.cancel_transmission:
cancelTransmission(selectedMessage);
return true;
+ case R.id.retry_decryption:
+ retryDecryption(selectedMessage);
+ return true;
default:
return super.onContextItemSelected(item);
}
@@ -673,6 +680,12 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
}
+ private void retryDecryption(Message message) {
+ message.setEncryption(Message.ENCRYPTION_PGP);
+ activity.xmppConnectionService.updateConversationUi();
+ conversation.getAccount().getPgpDecryptionService().add(message);
+ }
+
protected void privateMessageWith(final Jid counterpart) {
this.mEditMessage.setText("");
this.conversation.setNextCounterpart(counterpart);