Board Thread:Support Requests - Getting Technical/@comment-13172292-20140528204528/@comment-452-20140528213723

You would copy ChatHacks locally, and in the NodeRoomController.prototype.onPart function,

change var newChatEntry = new models.InlineAlert({text: $.msg('chat-user-parted', [connectedUser.get('name')] ) });

to /* yourRandomPartMessage = Your block of random selection code here */ var newChatEntry = new models.InlineAlert({text: yourRandomPartMessage }); edit: The simplest random selection would end up showing each user a different part message, but you could probably seed a random function with the UTC part-time in order to show the same message to everyone, but different each time.

edit: nevermind, this doesn't appear to work. I'm going to experiment with it and get back to you when I get it working.

Edit: This'll do it. It's a little rough, and like I mentioned, everyone will see a different message. It also expects that the join/part message hasn't been customised already. (It looks for "User has joined" and "User has left") NodeChatDiscussion.prototype.randomJoin = function (chat) { if(mainRoom.isInitialized && chat.attributes.name != wgUserName && chat.attributes.isInlineAlert) { if (chat.attributes.text.indexOf("has joined") != -1) { var joiningUser = chat.attributes.text.substr(0, chat.attributes.text.indexOf(" has joined"));

joinMessages = new Array("Uh oh, "+joiningUser+" is here", "Let's give "+joiningUser+" a big warm welcome");

$("#entry-"+chat.cid).text(joinMessages[Math.floor((Math.random*joinMessages.length))]); }     if (chat.attributes.text.indexOf("has left") != -1) { var partingUser = chat.attributes.text.substr(0, chat.attributes.text.indexOf(" has left"));

partMessages = new Array(partingUser +" has left the building", "We will miss "+partingUser +" now that he is gone");

$("#entry-"+chat.cid).text(partMessages[Math.floor((Math.random*partMessages.length))]); }   }  }  mainRoom.model.chats.bind('add', $.proxy(mainRoom.viewDiscussion.randomJoin, mainRoom.viewDiscussion));