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 2020/07/31 05:31:29 UTC

[camel] branch backport-camel-15349 updated (e76138f -> 7dc1a52)

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

acosentino pushed a change to branch backport-camel-15349
in repository https://gitbox.apache.org/repos/asf/camel.git.


 discard e76138f  Camel 15349 (#4058)
 discard 4327c32  Merge branch 'camel-3.4.x' of github.com:apache/camel into camel-3.4.x
    omit a2c3fa8  Regen and rebuild
     new 7dc1a52  Camel 15349 (#4058)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (e76138f)
            \
             N -- N -- N   refs/heads/backport-camel-15349 (7dc1a52)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:


[camel] 01/01: Camel 15349 (#4058)

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7dc1a52561fc340f7385c48b43d62b96e6887b0f
Author: vindiagram-ng <68...@users.noreply.github.com>
AuthorDate: Fri Jul 31 01:22:55 2020 -0400

    Camel 15349 (#4058)
    
    * Added function to resolve fully qualified JID for participants
    
    Changed the consumer to get the entityBareFrom the resolved participant
    JID
    
    * Fixed formatting issues outlined by sourcecheck
---
 .../java/org/apache/camel/component/xmpp/XmppConsumer.java |  2 +-
 .../java/org/apache/camel/component/xmpp/XmppEndpoint.java | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

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 37b643c..99be956 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
@@ -95,7 +95,7 @@ public class XmppConsumer extends DefaultConsumer implements IncomingChatMessage
         }
 
         if (endpoint.getRoom() == null) {
-            privateChat = chatManager.chatWith(JidCreate.entityBareFrom(endpoint.getChatId()));
+            privateChat = chatManager.chatWith(JidCreate.entityBareFrom(endpoint.resolveParticipant(connection)));
         } else {
             // add the presence packet listener to the connection so we only get packets that concerns us
             // we must add the listener before creating the muc
diff --git a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
index baaed9c..8a5cdd6 100644
--- a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
+++ b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
@@ -234,6 +234,20 @@ public class XmppEndpoint extends DefaultEndpoint implements HeaderFilterStrateg
         return new XMPPTCPConnection(conf);
     }
 
+    /**
+     * If there is no "@" symbol in the participant, find the service domain
+     * JID and return the fully qualified JID for the participant as user@server.domain
+     */
+    public String resolveParticipant(XMPPConnection connection) {
+        String participant = getParticipant();
+        
+        if (participant.indexOf('@', 0) != -1) {
+            return participant;
+        }
+        
+        return participant + "@" + connection.getXMPPServiceDomain().toString();
+    }
+    
     /*
      * If there is no "@" symbol in the room, find the chat service JID and
      * return fully qualified JID for the room as room@conference.server.domain