camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r783639 - /camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
Date Thu, 11 Jun 2009 05:51:16 GMT
Author: davsclaus
Date: Thu Jun 11 05:51:15 2009
New Revision: 783639

URL: http://svn.apache.org/viewvc?rev=783639&view=rev
Log:
CAMEL-1633: must add packet listener before creating muc.

Modified:
    camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java

Modified: camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java?rev=783639&r1=783638&r2=783639&view=diff
==============================================================================
--- camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
(original)
+++ camel/trunk/components/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
Thu Jun 11 05:51:15 2009
@@ -60,6 +60,12 @@
                 LOG.info("Open private chat to: " + privateChat.getParticipant());
             }
         } else {
+            // add the presence packet listener to the connection so we only get packets
that concers us
+            // we must add the listener before creating the muc
+            final ToContainsFilter toFilter = new ToContainsFilter(endpoint.getParticipant());
+            final AndFilter packetFilter = new AndFilter(new PacketTypeFilter(Presence.class),
toFilter);
+            connection.addPacketListener(this, packetFilter);
+
             muc = new MultiUserChat(connection, endpoint.resolveRoom(connection));
             muc.addMessageListener(this);
             DiscussionHistory history = new DiscussionHistory();
@@ -69,11 +75,6 @@
             if (LOG.isInfoEnabled()) {
                 LOG.info("Joined room: " + muc.getRoom() + " as: " + endpoint.getNickname());
             }
-
-            // add the presence packet listener to the connection so we only get packets
that concers us
-            final ToContainsFilter toFilter = new ToContainsFilter(endpoint.getParticipant());
-            final AndFilter packetFilter = new AndFilter(new PacketTypeFilter(Presence.class),
toFilter);
-            connection.addPacketListener(this, packetFilter);
         }
 
         super.doStart();



Mime
View raw message