diff options
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java | 5 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java | 11 |
2 files changed, 13 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index 04824193b..d4b0172db 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -477,9 +477,6 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate final MenuItem renewCertificate = menu.findItem(R.id.action_renew_certificate); final MenuItem mamPrefs = menu.findItem(R.id.action_mam_prefs); final MenuItem changePresence = menu.findItem(R.id.action_change_presence); - - changePresence.setVisible(manuallyChangePresence()); - renewCertificate.setVisible(mAccount != null && mAccount.getPrivateKeyAlias() != null); if (mAccount != null && mAccount.isOnlineAndConnected()) { @@ -494,6 +491,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate if (otherDevices == null || otherDevices.isEmpty()) { clearDevices.setVisible(false); } + changePresence.setVisible(manuallyChangePresence()); } else { showQrCode.setVisible(false); showBlocklist.setVisible(false); @@ -501,6 +499,7 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate changePassword.setVisible(false); clearDevices.setVisible(false); mamPrefs.setVisible(false); + changePresence.setVisible(false); } return super.onCreateOptionsMenu(menu); } diff --git a/src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java index feac2c622..e43db5d3e 100644 --- a/src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java @@ -121,9 +121,11 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda menu.findItem(R.id.mgmt_account_disable).setVisible(false); menu.findItem(R.id.mgmt_account_announce_pgp).setVisible(false); menu.findItem(R.id.mgmt_account_publish_avatar).setVisible(false); + menu.findItem(R.id.mgmt_account_change_presence).setVisible(false); } else { menu.findItem(R.id.mgmt_account_enable).setVisible(false); menu.findItem(R.id.mgmt_account_announce_pgp).setVisible(Config.supportOpenPgp()); + menu.findItem(R.id.mgmt_account_change_presence).setVisible(manuallyChangePresence()); } menu.setHeaderTitle(this.selectedAccount.getJid().toBareJid().toString()); } @@ -187,6 +189,9 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda case R.id.mgmt_account_announce_pgp: publishOpenPGPPublicKey(selectedAccount); return true; + case R.id.mgmt_account_change_presence: + changePresence(selectedAccount); + return true; default: return super.onContextItemSelected(item); } @@ -235,6 +240,12 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda } } + private void changePresence(Account account) { + Intent intent = new Intent(this, SetPresenceActivity.class); + intent.putExtra(SetPresenceActivity.EXTRA_ACCOUNT,account.getJid().toBareJid().toString()); + startActivity(intent); + } + public void onClickTglAccountState(Account account, boolean enable) { if (enable) { enableAccount(account); |