You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/12/23 10:32:46 UTC

[camel] branch master updated: CAMEL-14323 - XMPP room with password disconnect after bootup, thanks Tapio Piironen for the patch

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new aa775eb  CAMEL-14323 - XMPP room with password disconnect after bootup, thanks Tapio Piironen for the patch
aa775eb is described below

commit aa775eb3d14468d69c0c6e2a534b3fe5807059ad
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Dec 23 11:32:06 2019 +0100

    CAMEL-14323 - XMPP room with password disconnect after bootup, thanks Tapio Piironen for the patch
---
 .../java/org/apache/camel/component/xmpp/XmppConsumer.java    | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
index f5b7b74..7fbf0c3 100644
--- a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
+++ b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
@@ -98,13 +98,16 @@ public class XmppConsumer extends DefaultConsumer implements IncomingChatMessage
 
             final AndFilter packetFilter = new AndFilter(new StanzaTypeFilter(Presence.class));
             connection.addSyncStanzaListener(this, packetFilter);
+            String roomPassword = endpoint.getRoomPassword();
             MultiUserChatManager mucm = MultiUserChatManager.getInstanceFor(connection);
             muc = mucm.getMultiUserChat(JidCreate.entityBareFrom(endpoint.resolveRoom(connection)));
             muc.addMessageListener(this);
-            MucEnterConfiguration mucc = muc.getEnterConfigurationBuilder(Resourcepart.from(endpoint.getNickname()))
-                    .requestNoHistory()
-                    .build();
-            muc.join(mucc);
+            MucEnterConfiguration.Builder mucc = muc.getEnterConfigurationBuilder(Resourcepart.from(endpoint.getNickname()))
+                    .requestNoHistory();
+            if (roomPassword != null) {
+                mucc.withPassword(roomPassword);
+            }
+            muc.join(mucc.build());
             log.info("Joined room: {} as: {}", muc.getRoom(), endpoint.getNickname());
         }