powered by Jive Software

Found two small issues in Smack, is there a way to get them fixed?

  1. In smack/jingle/extension/source/org/jivesoftware/smackx/jingle/mediaimpl/demo/Dem o.java

The following line needs to be added during initialization for the demo to work

JingleManager.setJingleServiceEnabled();
  1. In smack

I was unfortunate enough to write the following code

multiUserChat.addMessageListener(voicezPacketListner);
     multiUserChat.addParticipantListener(voicezPacketListner);

It took me a LONG time to discover the problem, only after which I found the following comment in connection.addPacketListener(), which is called by both methods:

* which packets will be delivered to the listener. If the same packet listener
     * is added again with a different filter, only the new filter will be used.

Obviously, the method names are misleading. Instead of propogating the comment to all methods that add a packet listener, the listener should be changed to allow multiple filters. This can be done, for eg, by changing addPacketListener() to change any existing filter to an OrFiler:

In Connection::addPacketListener()

if(recvListeners.containsKey(packetListener))
            recvListeners.get(packetListener).addAlternateFilter(packetFilter);
     else ...

In ListenerWrapper:

public void addAlternateFilter(PacketFilter packetFilter2) {
            packetFilter = new OrFilter(packetFilter, packetFilter2);
     }

Which should fix, at least in theory : it didn’t work when I tried it out practically, and I’m too tried to find out why. Anyway, someone should fix that…
Demo_fix.patch.zip (407 Bytes)

Sounds like a change to a pretty fundamental bit of code that has the potential to break a lot of existing code. I think it would be safer to simply document the MUC case so developers are aware of the issue.