aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-09-06 15:11:43 +0200
committerDaniel Gultsch <daniel@gultsch.de>2014-09-06 15:11:43 +0200
commitdfc5942bda1088e75d1ad3bae8af4810e6a5aceb (patch)
treebc8a5c8046b7c181d9c7bff4498a535363171a7c
parentdc0213710640911a796880fcd68a75d2b576918d (diff)
parent375ec3a686f3fa18f9b440c85d643877186beb57 (diff)
Merge pull request #422 from betheg/muc_password
MUC: set password from invite message.
-rw-r--r--src/eu/siacs/conversations/parser/MessageParser.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java
index 0f95627d..4b9bb354 100644
--- a/src/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/eu/siacs/conversations/parser/MessageParser.java
@@ -285,6 +285,10 @@ public class MessageParser extends AbstractParser implements
.findOrCreateConversation(account,
packet.getAttribute("from"), true);
if (!conversation.getMucOptions().online()) {
+ if (x.hasChild("password")) {
+ Element password = x.findChild("password");
+ conversation.getMucOptions().setPassword(password.getContent());
+ }
mXmppConnectionService.joinMuc(conversation);
mXmppConnectionService.updateConversationUi();
}
@@ -293,10 +297,14 @@ public class MessageParser extends AbstractParser implements
} else if (packet.hasChild("x", "jabber:x:conference")) {
Element x = packet.findChild("x", "jabber:x:conference");
String jid = x.getAttribute("jid");
+ String password = x.getAttribute("password");
if (jid != null) {
Conversation conversation = mXmppConnectionService
.findOrCreateConversation(account, jid, true);
if (!conversation.getMucOptions().online()) {
+ if (password != null) {
+ conversation.getMucOptions().setPassword(password);
+ }
mXmppConnectionService.joinMuc(conversation);
mXmppConnectionService.updateConversationUi();
}