How to distinguish received messages between users using smack and java?

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

                  }
            }
+4
source share
1 answer
+2

Source: https://habr.com/ru/post/1539090/


All Articles