MUC: set password from invite message.

This commit is contained in:
Michael 2014-09-05 22:07:35 +02:00
parent dc02137106
commit 375ec3a686
1 changed files with 8 additions and 0 deletions

View File

@ -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();
}