aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-04-13 23:04:27 +0200
committerChristian Schneppe <christian@pix-art.de>2017-04-13 23:04:27 +0200
commite2ef2fe45feb650be610a56fd900b48105214ed3 (patch)
tree1b640f8e29cccf821e48b894d38e01f2e79fb444 /src/main/java
parentf1b500958c990241ad76c3e9476e1229b1141fa0 (diff)
integrate OpenPGP (untested)
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/pixart/messenger/ui/EditAccountActivity.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
index 5bd2ae001..ab1cbc836 100644
--- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java
@@ -577,6 +577,7 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
final MenuItem shareBarcode = menu.findItem(R.id.action_share_barcode);
final MenuItem shareHttp = menu.findItem(R.id.action_share_http);
final MenuItem shareUri = menu.findItem(R.id.action_share_uri);
+ final MenuItem announcePGP = menu.findItem(R.id.mgmt_account_announce_pgp);
renewCertificate.setVisible(mAccount != null && mAccount.getPrivateKeyAlias() != null);
if (mAccount != null && mAccount.isOnlineAndConnected()) {
@@ -587,9 +588,11 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
changePassword.setVisible(false);
}
reconnect.setVisible(true);
+ announcePGP.setVisible(true);
mamPrefs.setVisible(mAccount.getXmppConnection().getFeatures().mam());
changePresence.setVisible(manuallyChangePresence());
} else {
+ announcePGP.setVisible(false);
reconnect.setVisible(false);
showQrCode.setVisible(false);
showBlocklist.setVisible(false);
@@ -769,10 +772,21 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat
case R.id.action_show_password:
showPassword();
break;
+ case R.id.mgmt_account_announce_pgp:
+ publishOpenPGPPublicKey(mAccount);
+ return true;
}
return super.onOptionsItemSelected(item);
}
+ private void publishOpenPGPPublicKey(Account account) {
+ if (EditAccountActivity.this.hasPgp()) {
+ announcePgp(account, null, onOpenPGPKeyPublished);
+ } else {
+ this.showInstallPgpDialog();
+ }
+ }
+
private void shareLink(boolean http) {
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");