Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the actual hostname from a whois call #1

Merged
merged 4 commits into from
Jul 31, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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