camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-9847) XMPP: private chat response issue
Date Sat, 09 Apr 2016 10:44:25 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-9847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15233494#comment-15233494
] 

ASF GitHub Bot commented on CAMEL-9847:
---------------------------------------

GitHub user binfalse opened a pull request:

    https://github.com/apache/camel/pull/938

     camel-xmpp: fix private chat response issue 

    This fixes the issue with XMPP private chat responses, see https://issues.apache.org/jira/browse/CAMEL-9847

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/binfalse/camel master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/938.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #938
    
----
commit cbada76346fa0aae74128b2b74aa3a834144ea63
Author: Martin Scharm <martin@binfalse.de>
Date:   2016-04-09T09:53:12Z

    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();

commit cb1b8f6337c4795fc9d5046c204ff1e5dc86d533
Author: Martin Scharm <martin@binfalse.de>
Date:   2016-04-09T10:05:03Z

    Merge branch 'master' of github.com:binfalse/camel

----


> XMPP: private chat response issue
> ---------------------------------
>
>                 Key: CAMEL-9847
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9847
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-xmpp
>    Affects Versions: 2.17.0, 2.18.0
>         Environment: jdk1.8.0_65
>            Reporter: martin scharm
>
> There is an issue in the {{org.apache.camel.component.xmpp.XmppPrivateChatProducer}}
that prevents responding to XMPP private chat messages. The participant's address is obtained
as
> {code:java}
> String participant = exchange.getIn().getHeader(XmppConstants.TO, String.class);
> {code}
> (see https://github.com/apache/camel/blob/4ad8bcfde6ba931e526cd8680e211a397c6c71e7/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java#L68)
> In case of an incoming message that is the camel instance itself, not the participant.
However, from that it creates the outgoing message just as
> {code:java}
> message.setTo(participant);
> {code}
> (see https://github.com/apache/camel/blob/4ad8bcfde6ba931e526cd8680e211a397c6c71e7/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java#L82)
> Thus, responding to a chat message always results in a message to itself and not the
chat's other participant. 
> I fixed the issue in https://github.com/binfalse/camel/commit/cbada76346fa0aae74128b2b74aa3a834144ea63
by using the {{endpoint.getParticipant()}} to set the receipient of the message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message