From b45c84a68dbd8c22e4ef7c1f0fd2a402a5588978 Mon Sep 17 00:00:00 2001 From: LinuxMercedes Date: Thu, 23 Jul 2015 17:10:36 -0500 Subject: [PATCH 1/2] Calculate maxLength correctly, respecting options --- lib/irc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/irc.js b/lib/irc.js index b9159b25..23f9af6e 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -952,7 +952,7 @@ Client.prototype.notice = function(target, text) { Client.prototype._speak = function(kind, target, text) { var self = this; - var maxLength = this.maxLineLength - target.length; + var maxLength = Math.min(this.maxLineLength - target.length, this.opt.messageSplit); if (typeof text !== 'undefined') { text.toString().split(/\r?\n/).filter(function(line) { return line.length > 0; From 41c276c9384d1f1a39c990e555d46d568c8e2b25 Mon Sep 17 00:00:00 2001 From: LinuxMercedes Date: Thu, 23 Jul 2015 17:40:37 -0500 Subject: [PATCH 2/2] Get the actual hostname from a whois call --- lib/irc.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/irc.js b/lib/irc.js index b9159b25..7136c98b 100644 --- a/lib/irc.js +++ b/lib/irc.js @@ -128,6 +128,11 @@ function Client(server, nick, opt) { self.hostMask = welcomeStringWords[welcomeStringWords.length - 1]; self._updateMaxLineLength(); self.emit('registered', message); + self.whois(self.nick, function(args) { + self.nick = args.nick; + self.hostMask = args.user + "@" + args.host; + self._updateMaxLineLength(); + }); break; case 'rpl_myinfo': self.supported.usermodes = message.args[3];