chat between only 2 users
you have demonstrated chat application but it is chat room. For one application I need to allow user to chat with only one person who is in his friend list.
So scenario is that a user logges in application and on a sidebar he sees the currently logged in friends (who are his friends). Next to each logged in friend there is a button 'Chat', when it is clicked a chat window opens just as in gmail.
Now conversation is limited to only those 2 users.
If he wish to talk to another friend as well he has to click chat button next to that friend name, and then new chat window will open.
So please tell me where code would change and how it can be done?