aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/services
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-09-03 19:35:45 +0200
committeriNPUTmice <daniel@gultsch.de>2014-09-03 19:35:45 +0200
commit6b9219c5f4b81172edafae31b705fec3ef56b3f6 (patch)
tree0eda281b2827ae8466e9e0c2036fcec4b2630187 /src/eu/siacs/conversations/services
parentf19b1fb823db4fe1d132acc57f6dc7c368374644 (diff)
added support for password protected muc - fixed #203 and fixed #395
Diffstat (limited to 'src/eu/siacs/conversations/services')
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java11
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 98f278bd2..a294e970b 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();