From c14b67aeaab736b4f831e152dd28e97f339057ac Mon Sep 17 00:00:00 2001 From: Darren Date: Sat, 28 Sep 2013 13:10:16 +0100 Subject: [PATCH] Customisable realname on irc connections #401 --- config.example.js | 7 +++++++ server/irc/connection.js | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config.example.js b/config.example.js index 65237f3..e3cfcde 100644 --- a/config.example.js +++ b/config.example.js @@ -71,6 +71,13 @@ conf.max_server_conns = 0; */ conf.default_encoding = 'utf8'; + +/* +* Default GECOS (real name) for IRC connections +*/ +//conf.default_gecos = 'Web IRC Client'; + + /* * Client side plugins * Array of URLs that will be loaded into the browser when the client first loads up diff --git a/server/irc/connection.js b/server/irc/connection.js index 8b1d3ba..5278ad1 100644 --- a/server/irc/connection.js +++ b/server/irc/connection.js @@ -562,6 +562,8 @@ var socketConnectHandler = function () { connect_data = findWebIrc.call(this, connect_data); global.modules.emit('irc authorize', connect_data).done(function ircAuthorizeCb() { + var gecos = '[www.kiwiirc.com] ' + that.nick; + // Send any initial data for webirc/etc if (connect_data.prepend_data) { _.each(connect_data.prepend_data, function(data) { @@ -575,7 +577,7 @@ var socketConnectHandler = function () { that.write('PASS ' + that.password); that.write('NICK ' + that.nick); - that.write('USER ' + that.username + ' 0 0 :' + '[www.kiwiirc.com] ' + that.nick); + that.write('USER ' + that.username + ' 0 0 :' + (global.config.default_gecos || gecos)); that.emit('connected'); }); -- 2.25.1