Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9CF619EFB for ; Sat, 9 Apr 2016 12:10:05 +0000 (UTC) Received: (qmail 90801 invoked by uid 500); 9 Apr 2016 12:10:05 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 90713 invoked by uid 500); 9 Apr 2016 12:10:05 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 90685 invoked by uid 99); 9 Apr 2016 12:10:05 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Apr 2016 12:10:05 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 67930E0901; Sat, 9 Apr 2016 12:10:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Sat, 09 Apr 2016 12:10:06 -0000 Message-Id: In-Reply-To: <8c8973f282ad4dff933357a08b55b0d6@git.apache.org> References: <8c8973f282ad4dff933357a08b55b0d6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/4] camel git commit: camel-xmpp: fix private chat response issue 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/f7d0c2dc Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f7d0c2dc Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f7d0c2dc Branch: refs/heads/camel-2.17.x Commit: f7d0c2dcb1e6a5192c6293db5e6623da64eb61b2 Parents: 5732ceb Author: Martin Scharm Authored: Sat Apr 9 11:53:12 2016 +0200 Committer: Claus Ibsen Committed: Sat Apr 9 13:33:50 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/f7d0c2dc/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();