diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-04-13 23:04:27 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-04-13 23:04:27 +0200 |
commit | e2ef2fe45feb650be610a56fd900b48105214ed3 (patch) | |
tree | 1b640f8e29cccf821e48b894d38e01f2e79fb444 /src | |
parent | f1b500958c990241ad76c3e9476e1229b1141fa0 (diff) |
integrate OpenPGP (untested)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/EditAccountActivity.java | 14 | ||||
-rw-r--r-- | src/main/res/menu/editaccount.xml | 3 |
2 files changed, 17 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"); diff --git a/src/main/res/menu/editaccount.xml b/src/main/res/menu/editaccount.xml index 5841524e6..5541470d8 100644 --- a/src/main/res/menu/editaccount.xml +++ b/src/main/res/menu/editaccount.xml @@ -67,6 +67,9 @@ android:showAsAction="never" android:title="@string/mgmt_account_reconnect" /> <item + android:id="@+id/mgmt_account_announce_pgp" + android:title="@string/mgmt_account_publish_pgp" /> + <item android:id="@+id/action_settings" android:orderInCategory="100" android:showAsAction="never" |