diff options
author | Christian Schneppe <christian@pix-art.de> | 2016-12-18 21:46:07 +0100 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-12-18 21:46:07 +0100 |
commit | c5c02d306fdab8dc929d0c6cfd2fd186dfc70534 (patch) | |
tree | e338ba9ac0d20f86384613d2c92eef34763e4f24 /src/main/java/de/pixart/messenger | |
parent | ac7a6dca37d8b054cda815c7c38712870bd6fc86 (diff) |
disable 'show blocklist' if blocklist is empty
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/EditAccountActivity.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java index 41657e25b..7dedf693b 100644 --- a/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/EditAccountActivity.java @@ -56,6 +56,7 @@ import de.pixart.messenger.utils.UIHelper; import de.pixart.messenger.utils.XmppUri; import de.pixart.messenger.xml.Element; import de.pixart.messenger.xmpp.OnKeyStatusUpdated; +import de.pixart.messenger.xmpp.OnUpdateBlocklist; import de.pixart.messenger.xmpp.XmppConnection; import de.pixart.messenger.xmpp.XmppConnection.Features; import de.pixart.messenger.xmpp.forms.Data; @@ -63,7 +64,7 @@ import de.pixart.messenger.xmpp.jid.InvalidJidException; import de.pixart.messenger.xmpp.jid.Jid; import de.pixart.messenger.xmpp.pep.Avatar; -public class EditAccountActivity extends OmemoActivity implements OnAccountUpdate, +public class EditAccountActivity extends OmemoActivity implements OnAccountUpdate, OnUpdateBlocklist, OnKeyStatusUpdated, OnCaptchaRequested, KeyChainAliasCallback, XmppConnectionService.OnShowErrorToast, XmppConnectionService.OnMamPreferencesFetched { private static final int REQUEST_DATA_SAVER = 0x37af244; @@ -577,6 +578,8 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat if (mAccount != null && mAccount.isOnlineAndConnected()) { if (!mAccount.getXmppConnection().getFeatures().blocking()) { showBlocklist.setVisible(false); + } else { + showBlocklist.setEnabled(mAccount.getBlocklist().size() > 0); } if (!mAccount.getXmppConnection().getFeatures().register()) { changePassword.setVisible(false); @@ -1214,4 +1217,9 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } }); } + + @Override + public void OnUpdateBlocklist(Status status) { + refreshUi(); + } }
\ No newline at end of file |