Skip to content

Commit c9474ba

Browse files
committed
Merge pull request #1 from LinuxMercedes/bleeding
Get the actual hostname from a whois call
2 parents 94ba720 + 842ab05 commit c9474ba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/irc.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ function Client(server, nick, opt) {
128128
self.hostMask = welcomeStringWords[welcomeStringWords.length - 1];
129129
self._updateMaxLineLength();
130130
self.emit('registered', message);
131+
self.whois(self.nick, function(args) {
132+
self.nick = args.nick;
133+
self.hostMask = args.user + "@" + args.host;
134+
self._updateMaxLineLength();
135+
});
131136
break;
132137
case 'rpl_myinfo':
133138
self.supported.usermodes = message.args[3];
@@ -952,7 +957,7 @@ Client.prototype.notice = function(target, text) {
952957

953958
Client.prototype._speak = function(kind, target, text) {
954959
var self = this;
955-
var maxLength = this.maxLineLength - target.length;
960+
var maxLength = Math.min(this.maxLineLength - target.length, this.opt.messageSplit);
956961
if (typeof text !== 'undefined') {
957962
text.toString().split(/\r?\n/).filter(function(line) {
958963
return line.length > 0;

0 commit comments

Comments
 (0)