I search why my parrot-bot example doesn’‘t work and i don’'t understand … Can anyone to help me? I use psi or JBother to connect with user2 id. I receive the first message from user1 and I reply but user1 never receive any message…
Thanks for your help!
import org.jivesoftware.smack.Chat;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.packet.Message;
/**
@author ****
@version 15 mars 2004
*/
public class Test {
private static String serveur = “10.194.66.120”;
private static String user1 = “user1”;
private static String user2 = “user2”;
public static void main(String[] args) {
try {
XMPPConnection connection = new XMPPConnection(serveur);
That’‘s interesting. I just tried the standard parrot-bot example (from the Smack docs), and it doesn’'t work on Mac OS X 10.2 (1.4.1_01) or RH9 (1.4.2_04). Same symptoms – it creates the Chat and sends the initial message, but then never receives any reply sent by my other Jabber client (Nitro).
However, another program that just dumps all packets received to System.out, using a PacketListener, works just fine.
However, another program that just dumps all packets
received to System.out, using a PacketListener, works
just fine.
Are you adding the PacketListener to the XMPPConnection or to the Chat? If you are adding the PacketListener to the XMPPConnection I’'d then like to know the filter that you are using.
By default, the Chat will filter messages whose threadID matches the Chat’‘s threadID. Since the threadID is optional in XMPP, it’'s possible that this is generating the problem. You can open a debugger and check if the received packet includes a thread attribute or not. If you are not receiving it then you can set the Chat to NOT filter based on threadID. This will cause to filter the packets on ((Message.Type.CHAT and participant) or threadID).