aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-05-09 21:20:34 +0200
committerDaniel Gultsch <daniel.gultsch@rwth-aachen.de>2014-05-09 21:20:34 +0200
commitef0bc6714a71555b05ca3dea10c274a40605810c (patch)
tree14ca926d40be99bbbd10543ab876a990563a11a0 /src
parentf0eb80eb5cdf1b61b6c6d00d436d86650b8b3b43 (diff)
added dialog for otr file transfer
Diffstat (limited to 'src')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationActivity.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationActivity.java b/src/eu/siacs/conversations/ui/ConversationActivity.java
index d3e3737fa..234730fc2 100644
--- a/src/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/eu/siacs/conversations/ui/ConversationActivity.java
@@ -2,7 +2,6 @@ package eu.siacs.conversations.ui;
import java.io.FileNotFoundException;
import java.lang.ref.WeakReference;
-import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
@@ -390,6 +389,31 @@ public class ConversationActivity extends XmppActivity {
}
} else if (getSelectedConversation().getNextEncryption() == Message.ENCRYPTION_NONE) {
attachFileDialog();
+ } else {
+ AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ builder.setTitle(getString(R.string.otr_file_transfer));
+ builder.setMessage(getString(R.string.otr_file_transfer_msg));
+ builder.setNegativeButton(getString(R.string.cancel), null);
+ if (conversation.getContact().getPgpKeyId()==0) {
+ builder.setPositiveButton(getString(R.string.send_unencrypted), new OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ conversation.setNextEncryption(Message.ENCRYPTION_NONE);
+ attachFile();
+ }
+ });
+ } else {
+ builder.setPositiveButton(getString(R.string.use_pgp_encryption), new OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ conversation.setNextEncryption(Message.ENCRYPTION_PGP);
+ attachFile();
+ }
+ });
+ }
+ builder.create().show();
}
}