From b9604621ad1e10a593889d307e390e40c7e83f5d Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Fri, 14 Dec 2018 21:19:16 +0100 Subject: show warning snackbar before joining anon-non-private room --- .../java/de/pixart/messenger/services/XmppConnectionService.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/java/de/pixart/messenger/services') diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index ba583b304..bd68bd140 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -2551,6 +2551,11 @@ public class XmppConnectionService extends Service { private void join(Conversation conversation) { Account account = conversation.getAccount(); final MucOptions mucOptions = conversation.getMucOptions(); + if (mucOptions.nonanonymous() && !mucOptions.membersOnly() && !conversation.getBooleanAttribute("accept_non_anonymous", false)) { + mucOptions.setError(MucOptions.Error.NON_ANONYMOUS); + updateConversationUi(); + return; + } final Jid joinJid = mucOptions.getSelf().getFullJid(); Log.d(Config.LOGTAG, account.getJid().asBareJid().toString() + ": joining conversation " + joinJid.toString()); PresencePacket packet = mPresenceGenerator.selfPresence(account, Presence.Status.ONLINE, mucOptions.nonanonymous() || onConferenceJoined != null); -- cgit v1.2.3