1. //Checks if the user is chatbot
  2. if (userName == 'ChatBot'){
  3.     //Places the chatbot avatar in the variable
  4.     var AvatarPic = '<img src="img/chatbot.png"></img> ';
  5. }
  6. else{
  7.     //Places the UNIQUE user avatar in the variable
  8.     //outcome of this will be:
  9.     //<img title="UniqueUserName" alt="UniqueUserName" src="img/userID.png"></img>
  10.     var AvatarPic = '<img title="'
  11.                 + userName
  12.                 +'" alt="'
  13.                 + userName
  14.                 + '" src="img/'
  15.                 + userID
  16.                 +'.png"></img> ';
  17. }
  18.    
  19.  
  20. //Here is where everything is written to chat          
  21. return  '<div id="'
  22.         + this.getMessageDocumentID(messageID)
  23.         + '" class="'
  24.         + rowClass
  25.         + '">'
  26.         + this.getDeletionLink(messageID, userID, userRole, channelID)
  27.         + dateTime
  28.         //This is where the Avatar Line is inserted (just before the AjaxChat username
  29.         + AvatarPic        
  30.         + '<span class="'
  31.         + userClass
  32.         + '"'
  33.         + this.getChatListUserNameTitle(userID, userName, userRole, ip)
  34.         + ' dir="'
  35.         + this.baseDirection
  36.         + '" onclick="ajaxChat.insertText(this.firstChild.nodeValue);">'
  37.         + userName
  38.         + '</span>'
  39.         + colon
  40.         + this.replaceText(messageText)
  41.         + '</div>';