Below list of events that you can use : data of each event are encapsulated in mqttchat_data variable.
Event fires when chat iframe is completely loaded.
Event fires when currently user receives a message from another user.
Event fires when the number of unread messages changes.
Be carfeful, __initChatWithUser() must be called after MQTTChat script is completely loaded otherwise an error is triggered.
If contact exists in user's contact list or friend's list then chat window will be just opened . If not and if use friends option is enabled, contact is automatically added to the user's friends list before that the chat window will be opened.