aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-12-14 21:19:16 +0100
committerChristian Schneppe <christian@pix-art.de>2018-12-14 21:19:16 +0100
commitb9604621ad1e10a593889d307e390e40c7e83f5d (patch)
tree8011452a2b9819d9679e8a1a0095477ea4512807 /src/main/java/de/pixart/messenger/services
parent0a37d69814433d47f8b4731f4996d86f2e567b36 (diff)
show warning snackbar before joining anon-non-private room
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java5
1 files changed, 5 insertions, 0 deletions
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);