powered by Jive Software

Private chat with more than one user at the same time

Hi!

If I have a user that wants to make private chat with more than one user at same time in a differents windows(I mean every private chat in a different window). do you have any idea how can I route the messages to the appropriate window at the same time?Is it the place to use the filter mechanism? Can You send me a code example tha demonstrate it?

This would be something your application logic would need to work out. You are correct in assuming a filter would be good to use.

You could add a PacketListener to your connection, this listener listens out for Message packets. If the message packet is of type CHAT, you could check to see of you are currently chatting with the sender of the message. Depending on whether or not you are, either open up a new GUI window and display the message or display the message in the existing window.