diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-12-03 23:49:00 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-12-03 23:49:00 +0100 |
commit | 1a89915b31162437d61f167959e3db55459c4f5a (patch) | |
tree | 07dc3a0323a1e4e3f537417ba203077f2ac4675c /src | |
parent | a5b3c579c4c37baed1db07f4558f53a197a4881e (diff) |
disable 'show blocklist' if blocklist is empty. fixes #2164
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java index 4c576771..e1035db6 100644 --- a/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/EditAccountActivity.java @@ -56,6 +56,7 @@ import eu.siacs.conversations.utils.UIHelper; import eu.siacs.conversations.utils.XmppUri; import eu.siacs.conversations.xml.Element; import eu.siacs.conversations.xmpp.OnKeyStatusUpdated; +import eu.siacs.conversations.xmpp.OnUpdateBlocklist; import eu.siacs.conversations.xmpp.XmppConnection; import eu.siacs.conversations.xmpp.XmppConnection.Features; import eu.siacs.conversations.xmpp.forms.Data; @@ -63,7 +64,7 @@ import eu.siacs.conversations.xmpp.jid.InvalidJidException; import eu.siacs.conversations.xmpp.jid.Jid; import eu.siacs.conversations.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; @@ -573,6 +574,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); @@ -1199,4 +1202,9 @@ public class EditAccountActivity extends OmemoActivity implements OnAccountUpdat } }); } + + @Override + public void OnUpdateBlocklist(Status status) { + refreshUi(); + } } |