I use servlets to send and receive chat messages on facebook using smack. In this user, “A” and “B” are reading with user “C”. If user "C" sends only "A" message, this message also receives "B". How to distinguish between messages between users?
Finally, my problem is to whom cmg post from facebook.
Using the code below to receive messages:
public void processMessage(Chat chat, Message message) {
if ((message != null) && (message.getBody() != null)) {
System.out.println(chat.getParticipant() +"--"+ message.getBody());
}
}
source
share