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