<commit_before>UI.once('init', function(){
	var UI = this
	  , messages = new MessageList()
	  , newline = Util.Text.newlineMatcher
	  , last_line = null
	  , msgs = [];

	function prepareMessageElement(el, text){
		if(newline.test(text)){
			text
				.split(newline)
				.forEach(function(line){
					el.append(linkifyAndInsert($('<div>'), line));
				});
		}else{
			linkifyAndInsert(el,text);
		}
		
		el.addClass('msg');
		return el;
	}
	
	function linkifyAndInsert(el, text){
		if(Util.Text.linkifyTest(text)){
			//escape <,> so we don't include any nasty html tags
			text = text.replace(/</g, '&lt;').replace(/>/g,'&gt;');
			el.html(Util.Text.linkify(text));
		}
		else
			el.text(text);
		return el;
	}
	
	
	function pruneOldMessages(){
		var num_to_remove = msgs.length - WOMPT.messages.max_shown;
		
		if(num_to_remove <=0) return;

		for(var i=0; i < num_to_remove; i++){
			var msg = msgs[i], next = msgs[i+1];
			if(msg.from.id == next.from.id){
				next.nick.text(next.from.name);
				next.nick.css('color', UI.Colors.forUser(next.from.id));
				next.nick.addClass('name');
				next.line.addClass('first');
			}
			msg.line.remove();
		}

		msgs.splice(0,num_to_remove);
	}
	
	function firstMessageInGroup(msg){
		msg.nick.text(msg.from.name);
		msg.nick.css('color', UI.Colors.forUser(msg.from.id));
		msg.nick.addClass('name');
		msg.line.addClass('first');
	}

	function join_part(text){
		return function(msg){
			var names = [];
			$.each(msg.users, function(id, u){
				names.push(u.name);
			});
			UI.Messages.system(text + names.join(','));
		}
	}
	
	UI.Messages = {
		list:messages,
		
		actions:{
			join: join_part("Joined: "),
			part: join_part("Left: "),
			
			message: function(data){
				UI.emit('before_append', data);
				UI.Messages.appendWithoutEvents(data);
				UI.emit('after_append', data);
				UI.emit('user_message', data);
			},
			<commit_msg>Remove system messages from the UI entirely<commit_after>UI.once('init', function(){
	var UI = this
	  , messages = new MessageList()
	  , newline = Util.Text.newlineMatcher
	  , last_line = null
	  , msgs = [];

	function prepareMessageElement(el, text){
		if(newline.test(text)){
			text
				.split(newline)
				.forEach(function(line){
					el.append(linkifyAndInsert($('<div>'), line));
				});
		}else{
			linkifyAndInsert(el,text);
		}
		
		el.addClass('msg');
		return el;
	}
	
	function linkifyAndInsert(el, text){
		if(Util.Text.linkifyTest(text)){
			//escape <,> so we don't include any nasty html tags
			text = text.replace(/</g, '&lt;').replace(/>/g,'&gt;');
			el.html(Util.Text.linkify(text));
		}
		else
			el.text(text);
		return el;
	}
	
	
	function pruneOldMessages(){
		var num_to_remove = msgs.length - WOMPT.messages.max_shown;
		
		if(num_to_remove <=0) return;

		for(var i=0; i < num_to_remove; i++){
			var msg = msgs[i], next = msgs[i+1];
			if(msg.from.id == next.from.id){
				next.nick.text(next.from.name);
				next.nick.css('color', UI.Colors.forUser(next.from.id));
				next.nick.addClass('name');
				next.line.addClass('first');
			}
			msg.line.remove();
		}

		msgs.splice(0,num_to_remove);
	}
	
	function firstMessageInGroup(msg){
		msg.nick.text(msg.from.name);
		msg.nick.css('color', UI.Colors.forUser(msg.from.id));
		msg.nick.addClass('name');
		msg.line.addClass('first');
	}

	UI.Messages = {
		list:messages,
		
		actions:{
			message: function(data){
				UI.emit('before_append', data);
				UI.Messages.appendWithoutEvents(data);
				UI.emit('after_append', data);
				UI.emit('user_message', data);
			},
			
{'fraction_non_alphanumeric': 0.1847672778561354, 'fraction_numerical': 0.002256699576868829, 'mean_word_length': 3.443609022556391, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6589800', 'n_tokens_mistral': 1547, 'n_tokens_neox': 1307, 'n_words': 212}