Repository: camel Updated Branches: refs/heads/camel-2.16.x eed00f12d -> 3f48f0604 refs/heads/camel-2.17.x 5732ceb1c -> f7d0c2dcb refs/heads/master 4ad8bcfde -> 342c21829
camel-xmpp: fix private chat response issue Responding to a private chat wasn't able because the message was always sent to String participant = exchange.getIn().getHeader(XmppConstants.TO, String.class); However, the `XmppConstants.TO` in such messages is the camel instance (which received the message) and not the chat's other participant. Thus, responding to a chat message always resultet in a message to itself. This patch fixes that issue and addresses messages always to String participant = endpoint.getParticipant(); Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f4146a75 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f4146a75 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f4146a75 Branch: refs/heads/master Commit: f4146a7594bdc6d22ae392afc203f3a876c190ed Parents: 4ad8bcf Author: Martin Scharm <mar...@binfalse.de> Authored: Sat Apr 9 11:53:12 2016 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sat Apr 9 13:31:11 2016 +0200 ---------------------------------------------------------------------- .../org/apache/camel/component/xmpp/XmppPrivateChatProducer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/f4146a75/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java index 322980b..d56e108 100644 --- a/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java +++ b/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java @@ -65,7 +65,7 @@ public class XmppPrivateChatProducer extends DefaultProducer { throw new RuntimeException("Could not connect to XMPP server.", e); } - String participant = exchange.getIn().getHeader(XmppConstants.TO, String.class); + String participant = endpoint.getParticipant(); String thread = endpoint.getChatId(); if (participant == null) { participant = getParticipant();