LPS-33418 - The minified chat window is gone if the user goes to another page of the portal

Hey Marc,

I found some issues with this pull.

When I have 0 buddies, it throws a JS error and when I minimize the chat window
When user A is chatting with user B, and user B minimizes the chat window, on the page refresh, it does not show the last message sent by user B. I only see the last message sent from user A.
I have fixed the JS issue with my source formatting, but can you check?

This issue can be found at http://issues.liferay.com/browse/LPS-33418

Please let me know if you have any questions.

Thanks!

- Jon Mak