diff options
Diffstat (limited to 'src/eu/siacs/conversations/services/XmppConnectionService.java')
-rw-r--r-- | src/eu/siacs/conversations/services/XmppConnectionService.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java index 98f278bd..a294e970 100644 --- a/src/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/eu/siacs/conversations/services/XmppConnectionService.java @@ -1059,6 +1059,10 @@ public class XmppConnectionService extends Service { packet.setAttribute("to", conversation.getMucOptions().getJoinJid()); Element x = new Element("x"); x.setAttribute("xmlns", "http://jabber.org/protocol/muc"); + if (conversation.getMucOptions().getPassword() != null) { + Element password = x.addChild("password"); + password.setContent(conversation.getMucOptions().getPassword()); + } String sig = account.getPgpSignature(); if (sig != null) { packet.addChild("status").setContent("online"); @@ -1090,6 +1094,13 @@ public class XmppConnectionService extends Service { public void setOnRenameListener(OnRenameListener listener) { this.renameListener = listener; } + + public void providePasswordForMuc(Conversation conversation, String password) { + if (conversation.getMode() == Conversation.MODE_MULTI) { + conversation.getMucOptions().setPassword(password); + joinMuc(conversation); + } + } public void renameInMuc(final Conversation conversation, final String nick) { final MucOptions options = conversation.getMucOptions(); |