modification:

1.add friends nick name and group name cache dict, to translate user
  name and group name display in chatting and chat history, avoiding
  to use jquery selector each time;
2.add font size and font family cache to record user changes so that
  the change will apply to newly posted and received messages as well;
3.some user click logic improvements to make user interact more
  reasonable.