<commit_before>/*
 * Global server wide users list handling
 */
Ape.addEvent('adduser', function(user) {
	var name = user.prop('name');
	
	if(typeof name == "string"){
		name = name.toLowerCase();
		userlist[name] = user;
	}
});

Ape.addEvent('deluser', function(user) {
	var name = user.prop('name');
	
	if(typeof name == "string"){
		name = name.toLowerCase();
		delete userlist[name];
	}
});

/*
 * Global server wide channel's users counter
 */
Ape.addEvent("mkchan", function(channel) {
	//Create users property	
	channel.users = {};
	
	channel.prop("userCount", 0);
});

Ape.addEvent("beforeJoin", function(user, channel) {
	channel.prop("userCount", parseInt(channel.prop("userCount")) + 1);
	
	channel.users[user.prop("pubid")] = user;
	
	user.channels[channel.prop("name")] = channel;
	//Ape.log(channel.userCount +" users In channel "+ channel.getProperty("name"));
});

Ape.addEvent("left", function(user, channel) {
	channel.prop("userCount", parseInt(channel.prop("userCount")) - 1);
	
	delete channel.users[user.prop("pubid")];
	delete user.channels[channel.prop("name")];
	//Ape.log(channel.userCount +" users In channel "+ channel.getProperty("name"));
});

Ape.addEvent("beforeJoin", function(user, channel) {
	/*
	Ape.log("========= TEST ==========");
	Ape.log("========= User ==========");
	Ape.log(user.prop("name"));
	Ape.log(user.prop());
	Ape.log("======== Channel ========");
	Ape.log(channel.prop("name"));
	Ape.log(channel.prop());
	Ape.log("=======================");
	*/
});
<commit_msg>remove usercount property from channel objects<commit_after>/*
 * Global server wide users list handling
 */
Ape.addEvent('adduser', function(user) {
	var name = user.prop('name');
	
	if(typeof name == "string"){
		name = name.toLowerCase();
		userlist[name] = user;
	}
});

Ape.addEvent('deluser', function(user) {
	var name = user.prop('name');
	
	if(typeof name == "string"){
		name = name.toLowerCase();
		delete userlist[name];
	}
});

/*
 * Global server wide channel's users counter
 */
Ape.addEvent("mkchan", function(channel) {
	//Create users property	
	channel.users = {};
});

Ape.addEvent("beforeJoin", function(user, channel) {
	channel.users[user.prop("pubid")] = user;
	
	user.channels[channel.prop("name")] = channel;
});

Ape.addEvent("left", function(user, channel) {
	delete channel.users[user.prop("pubid")];
	delete user.channels[channel.prop("name")];
});
{'fraction_non_alphanumeric': 0.22732971165900542, 'fraction_numerical': 0.0012536564981195152, 'mean_word_length': 5.122762148337596, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6637284', 'n_tokens_mistral': 832, 'n_tokens_neox': 801, 'n_words': 151}