Search code examples
androidchatasmackquickblox

asmack android peer to peer chat also shows 3rd user chat message in chat


I m developing android chat app using asmack api with quickblox.

I'm facing problem that in peer to peer chat, i also receive 3rd user chat message in my peer chat.

Any hint or help is appreciated.

Thanks


Solution

  • In the OnMessageReceivedListener check for message received id

    String messageString = message.getBody();
      String test=message.getFrom();
      if((friendID+"/Smack").equals(message.getFrom()))
      {
    
      }
    

    where friend-ID is the id , to which you are connected.