Skip to content

Commit

Permalink
Merge pull request #1 from LinuxMercedes/bleeding
Browse files Browse the repository at this point in the history
Get the actual hostname from a whois call
  • Loading branch information
kegsay committed Jul 31, 2015
2 parents 94ba720 + 842ab05 commit c9474ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/irc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -952,7 +957,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;
Expand Down

0 comments on commit c9474ba

Please sign in to comment.