/*
 * @package AJAX_Chat
 * @author Sebastian Tschan
 * @copyright (c) Sebastian Tschan
 * @license GNU Affero General Public License
 * @link https://blueimp.net/ajax/
 */

// Overrides functionality for the shoutbox view:

	ajaxChat.handleLogout = function() {
	}

	ajaxChat.addMessageToChatList = function(dateObject, userID, userName, userRole, messageID, messageText, channelID, ip) {
		// Prevent adding the same message twice:
		if(this.getMessageNode(messageID)) {
			return;
		}		
		if(!this.onNewMessage(dateObject, userID, userName, userRole, messageID, messageText, channelID, ip)) {
			return;
		}
		this.DOMbufferRowClass = this.DOMbufferRowClass == 'rowEven' ? 'rowOdd' : 'rowEven';
		this.DOMbuffer = 
			this.getChatListMessageString(
				dateObject, userID, userName, userRole, messageID, messageText, channelID, ip
			)
			+ this.DOMbuffer;
		if(!this.DOMbuffering){
 			this.updateDOM('chatList', this.DOMbuffer, true)
 			this.DOMbuffer = "";
			SBscrollReset();
 		}
	}

	ajaxChat.initEmoticons = function() {
		this.DOMbuffer = "";
		for(var i=0; i<this.emoticonCodes.length; i++) {
			// Replace specials characters in emoticon codes:
			this.emoticonCodes[i] = this.encodeSpecialChars(this.emoticonCodes[i]);
			this.DOMbuffer = this.DOMbuffer
						+ '<span onclick="ajaxChat.insertText(\''
						+ this.emoticonCodes[i]
						+ '\');"><img src="'
						+ this.dirs['emoticons']
						+ this.emoticonFiles[i]
						+ '" alt="'
						+ this.emoticonCodes[i]
						+ '" title="'
						+ this.emoticonCodes[i]
						+ '"/></span>';
			}
		if(this.dom['emoticonsContainer']) {
 			this.updateDOM('emoticonsContainer', this.DOMbuffer);
 		}
 		this.DOMbuffer = "";
	}
	

