From 3bea5b25cd5496cd3f14a66c208b34d0c8e48b03 Mon Sep 17 00:00:00 2001 From: Andreas Straub Date: Tue, 12 Jan 2016 09:32:22 +0100 Subject: Add additional warnings to OMEMO purge key function People continue to press the "don't press this" button. Maybe adding some warnings indicating that this button will not fix their problems will help... --- .../eu/siacs/conversations/ui/XmppActivity.java | 28 ++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'src/main/java/eu/siacs/conversations') diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index 36e82b2a7..a9d2bc856 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -786,8 +786,32 @@ public abstract class XmppActivity extends Activity { new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - account.getAxolotlService().purgeKey(fingerprint); - refreshUi(); + Builder builder = new Builder(XmppActivity.this); + builder.setTitle(getString(R.string.purge_key)); + builder.setIconAttribute(android.R.attr.alertDialogIcon); + builder.setMessage(getString(R.string.purge_key_warning)); + builder.setNegativeButton(getString(R.string.cancel), null); + builder.setPositiveButton(getString(R.string.accept), + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + Builder builder = new Builder(XmppActivity.this); + builder.setTitle(getString(R.string.purge_key)); + builder.setIconAttribute(android.R.attr.alertDialogIcon); + builder.setMessage(getString(R.string.purge_key_warning2)); + builder.setNegativeButton(getString(R.string.cancel), null); + builder.setPositiveButton(getString(R.string.accept), + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + account.getAxolotlService().purgeKey(fingerprint); + refreshUi(); + } + }); + builder.create().show(); + } + }); + builder.create().show(); } }); builder.create().show(); -- cgit v1.2.3