<commit_before>var _ = require("lodash");
var package = require("../package.json");
var Chan = require("./models/chan");
var crypto = require("crypto");
var userLog = require("./userLog");
var Msg = require("./models/msg");
var Network = require("./models/network");
var ircFramework = require("irc-framework");
var Helper = require("./helper");

module.exports = Client;

var id = 0;
var events = [
	"connection",
	"ctcp",
	"error",
	"invite",
	"join",
	"kick",
	"mode",
	"motd",
	"message",
	"link",
	"names",
	"nick",
	"part",
	"quit",
	"topic",
	"welcome",
	"whois"
];
var inputs = [
	"ctcp",
	"msg",
	"part",
	"action",
	"connect",
	"disconnect",
	"invite",
	"kick",
	"mode",
	"notice",
	"query",
	"quit",
	"raw",
	"topic",
].reduce(function(plugins, name) {
	var path = "./plugins/inputs/" + name;
	var plugin = require(path);
	plugin.commands.forEach(function(command) {
		plugins[command] = plugin;
	});
	return plugins;
}, {});

function Client(manager, name, config) {
	_.merge(this, {
		activeChannel: -1,
		config: config,
		id: id++,
		name: name,
		networks: [],
		sockets: manager.sockets,
		manager: manager
	});

	var client = this;

	if (config) {
		if (!config.token) {
			client.updateToken(function() {
				client.manager.updateUser(client.name, {token: config.token});
			});
		}

		var delay = 0;
		(config.networks || []).forEach(function(n) {
			setTimeout(function() {
				client.connect(n);
			}, delay);
			delay += 1000;
		});
	}

	log.info("User '" + name + "' loaded");
}

Client.prototype.emit = function(event, data) {
	if (this.sockets !== null) {
		this.sockets.in(this.id).emit(event, data);
	}
	var config = this.config || {};
	if (config.log === true) {
		if (event === "msg") {
			var target = this.find(data.chan);
			if (target) {
				var chan = target.chan.name;<commit_msg>Do not print user loaded message in public mode<commit_after>var _ = require("lodash");
var package = require("../package.json");
var Chan = require("./models/chan");
var crypto = require("crypto");
var userLog = require("./userLog");
var Msg = require("./models/msg");
var Network = require("./models/network");
var ircFramework = require("irc-framework");
var Helper = require("./helper");

module.exports = Client;

var id = 0;
var events = [
	"connection",
	"ctcp",
	"error",
	"invite",
	"join",
	"kick",
	"mode",
	"motd",
	"message",
	"link",
	"names",
	"nick",
	"part",
	"quit",
	"topic",
	"welcome",
	"whois"
];
var inputs = [
	"ctcp",
	"msg",
	"part",
	"action",
	"connect",
	"disconnect",
	"invite",
	"kick",
	"mode",
	"notice",
	"query",
	"quit",
	"raw",
	"topic",
].reduce(function(plugins, name) {
	var path = "./plugins/inputs/" + name;
	var plugin = require(path);
	plugin.commands.forEach(function(command) {
		plugins[command] = plugin;
	});
	return plugins;
}, {});

function Client(manager, name, config) {
	_.merge(this, {
		activeChannel: -1,
		config: config,
		id: id++,
		name: name,
		networks: [],
		sockets: manager.sockets,
		manager: manager
	});

	var client = this;

	if (config) {
		if (!config.token) {
			client.updateToken(function() {
				client.manager.updateUser(client.name, {token: config.token});
			});
		}

		var delay = 0;
		(config.networks || []).forEach(function(n) {
			setTimeout(function() {
				client.connect(n);
			}, delay);
			delay += 1000;
		});

		log.info("User '" + name + "' loaded");
	}
}

Client.prototype.emit = function(event, data) {
	if (this.sockets !== null) {
		this.sockets.in(this.id).emit(event, data);
	}
	var config = this.config || {};
	if (config.log === true) {
		if (event === "msg") {
			var target = this.find(data.chan);
			if (target) {
				var chan = target.chan.name;
{'fraction_non_alphanumeric': 0.20998091082628853, 'fraction_numerical': 0.003817834742296155, 'mean_word_length': 3.7760416666666665, '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': '6666521', 'n_tokens_mistral': 1468, 'n_tokens_neox': 1351, 'n_words': 301}