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:34:52 UTC
[camel] branch camel-3.0.x 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 camel-3.0.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.0.x by this push:
new 7c4f569 CAMEL-14323 - XMPP room with password disconnect after bootup, thanks Tapio Piironen for the patch
7c4f569 is described below
commit 7c4f569027b3e4969a142cf594f42cf0dc1c6242
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());
}