aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-04-23 12:33:56 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-04-23 12:33:56 +0200
commitcd1fbf60ec920bbdb179c437a06db66a4de19483 (patch)
tree942692178fbe4772bc1f8eb6b167bb805be4d0dc /src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java
parenta9c17681077c82b7095aa62b10f4f78c7a467e60 (diff)
add change prescence to manage account context menu
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ManageAccountActivity.java11
1 files changed, 11 insertions, 0 deletions
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);