aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-12-18 21:46:07 +0100
committerChristian Schneppe <christian@pix-art.de>2016-12-18 21:46:07 +0100
commitc5c02d306fdab8dc929d0c6cfd2fd186dfc70534 (patch)
treee338ba9ac0d20f86384613d2c92eef34763e4f24 /src/main
parentac7a6dca37d8b054cda815c7c38712870bd6fc86 (diff)
disable 'show blocklist' if blocklist is empty
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/ui/EditAccountActivity.java10
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