mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-11 11:45:01 -05:00
hide change password menu item if server feature is unavailable
This commit is contained in:
parent
a022e4b41a
commit
6ad4865d96
@ -332,17 +332,18 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
|
|||||||
final MenuItem showBlocklist = menu.findItem(R.id.action_show_block_list);
|
final MenuItem showBlocklist = menu.findItem(R.id.action_show_block_list);
|
||||||
final MenuItem showMoreInfo = menu.findItem(R.id.action_server_info_show_more);
|
final MenuItem showMoreInfo = menu.findItem(R.id.action_server_info_show_more);
|
||||||
final MenuItem changePassword = menu.findItem(R.id.action_change_password_on_server);
|
final MenuItem changePassword = menu.findItem(R.id.action_change_password_on_server);
|
||||||
if (mAccount == null) {
|
if (mAccount != null && mAccount.isOnlineAndConnected()) {
|
||||||
|
if (!mAccount.getXmppConnection().getFeatures().blocking()) {
|
||||||
|
showBlocklist.setVisible(false);
|
||||||
|
}
|
||||||
|
if (!mAccount.getXmppConnection().getFeatures().register()) {
|
||||||
|
changePassword.setVisible(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
showQrCode.setVisible(false);
|
showQrCode.setVisible(false);
|
||||||
showBlocklist.setVisible(false);
|
showBlocklist.setVisible(false);
|
||||||
showMoreInfo.setVisible(false);
|
showMoreInfo.setVisible(false);
|
||||||
changePassword.setVisible(false);
|
changePassword.setVisible(false);
|
||||||
} else if (mAccount.getStatus() != Account.State.ONLINE) {
|
|
||||||
showBlocklist.setVisible(false);
|
|
||||||
showMoreInfo.setVisible(false);
|
|
||||||
changePassword.setVisible(false);
|
|
||||||
} else if (!mAccount.getXmppConnection().getFeatures().blocking()) {
|
|
||||||
showBlocklist.setVisible(false);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user