title: How to map users for chatting?
body: <p>I am building a new chat application with a real-time communication server. I can send and receive messages from the server. Now I need to map the the users for private real time communication. How can I get it either client side or server side? </p>
  
  <p>I am getting msg from the server as follows:</p>
  
  <pre>
  msg:"blah blah",
  participants: [id1,id99],
  sessionid: "I need to create unique id for each conversation"(this id is the whole thing to maintain msgs between users), 
  </pre>
  
  <p>use case </p>
  
  <ol>
  <li>I have 100 users</li>
  <li>I have to send a message from 1 to 55</li>
  <li>Now I need to map 1 and 55</li>
  <li>One more 2 to 33</li>
  <li>Again I need to map 2 and 33</li>
  <li>Similarly I need to map each and every user with other user. </li>
  </ol>
  
  <p>Is there anything wrong in my approach?</p>
  
  <p>Please suggest what the other approaches are for building a multi-user chat application with JavaScript?</p>