Skip to content

Commit

Permalink
Merge pull request #275 from martynsmith/jirwin/remove-editor-folding…
Browse files Browse the repository at this point in the history
…-hints-again

fix(style): Remove folding hints from codes and irc.
  • Loading branch information
Chris Nehren committed Jan 8, 2015
2 parents c6f9274 + 2153f45 commit 9ce8133
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions lib/codes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = { // {{{
module.exports = {
'001': {
name: 'rpl_welcome',
type: 'reply'
Expand Down Expand Up @@ -511,4 +511,4 @@ module.exports = { // {{{
name: 'err_usersdontmatch',
type: 'error'
}
}; // }}}
};
72 changes: 36 additions & 36 deletions lib/irc.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function Client(server, nick, opt) {
self.connect();
}

self.addListener('raw', function(message) { // {{{
self.addListener('raw', function(message) {
var channels = [],
channel,
nick,
Expand Down Expand Up @@ -586,7 +586,7 @@ function Client(server, nick, opt) {
break;
}
}
}); // }}}
});

self.addListener('kick', function(channel, who, by, reason) {
if (self.opt.autoRejoin)
Expand All @@ -608,7 +608,7 @@ Client.prototype.prefixForMode = {};
Client.prototype.modeForPrefix = {};
Client.prototype.chans = {};
Client.prototype._whoisData = {};
Client.prototype.chanData = function(name, create) { // {{{
Client.prototype.chanData = function(name, create) {
var key = name.toLowerCase();
if (create) {
this.chans[key] = this.chans[key] || {
Expand All @@ -620,8 +620,8 @@ Client.prototype.chanData = function(name, create) { // {{{
}

return this.chans[key];
}; // }}}
Client.prototype.connect = function(retryCount, callback) { // {{{
};
Client.prototype.connect = function(retryCount, callback) {
if (typeof (retryCount) === 'function') {
callback = retryCount;
retryCount = undefined;
Expand Down Expand Up @@ -749,8 +749,8 @@ Client.prototype.connect = function(retryCount, callback) { // {{{
self.conn.addListener('error', function(exception) {
self.emit('netError', exception);
});
}; // }}}
Client.prototype.disconnect = function(message, callback) { // {{{
};
Client.prototype.disconnect = function(message, callback) {
if (typeof (message) === 'function') {
callback = message;
message = undefined;
Expand All @@ -772,8 +772,8 @@ Client.prototype.disconnect = function(message, callback) { // {{{
self.conn.once('end', callback);
}
self.conn.end();
}; // }}}
Client.prototype.send = function(command) { // {{{
};
Client.prototype.send = function(command) {
var args = Array.prototype.slice.call(arguments);

// Note that the command arg is included in the args array as the first element
Expand All @@ -788,8 +788,8 @@ Client.prototype.send = function(command) { // {{{
if (!this.conn.requestedDisconnect) {
this.conn.write(args.join(' ') + '\r\n');
}
}; // }}}
Client.prototype.activateFloodProtection = function(interval) { // {{{
};
Client.prototype.activateFloodProtection = function(interval) {

var cmdQueue = [],
safeInterval = interval || this.opt.floodProtectionDelay,
Expand Down Expand Up @@ -821,9 +821,9 @@ Client.prototype.activateFloodProtection = function(interval) { // {{{
// Slowly unpack the queue without flooding.
setInterval(dequeue, safeInterval);
dequeue();
}; // }}}
};

Client.prototype.join = function(channel, callback) { // {{{
Client.prototype.join = function(channel, callback) {
var channelName = channel.split(' ')[0];
this.once('join' + channelName, function() {
// if join is successful, add this channel to opts.channels
Expand All @@ -838,8 +838,8 @@ Client.prototype.join = function(channel, callback) { // {{{
}
});
this.send.apply(this, ['JOIN'].concat(channel.split(' ')));
}; // }}}
Client.prototype.part = function(channel, message, callback) { // {{{
};
Client.prototype.part = function(channel, message, callback) {
if (typeof (message) === 'function') {
callback = message;
message = undefined;
Expand All @@ -859,8 +859,8 @@ Client.prototype.part = function(channel, message, callback) { // {{{
} else {
this.send('PART', channel);
}
}; // }}}
Client.prototype.action = function(channel, text) { // {{{
};
Client.prototype.action = function(channel, text) {
var self = this;
if (typeof text !== 'undefined') {
text.toString().split(/\r?\n/).filter(function(line) {
Expand All @@ -869,8 +869,8 @@ Client.prototype.action = function(channel, text) { // {{{
self.say(channel, '\u0001ACTION ' + line + '\u0001');
});
}
}; // }}}
Client.prototype._splitLongLines = function(words, maxLength, destination) { // {{{
};
Client.prototype._splitLongLines = function(words, maxLength, destination) {
if (words.length < maxLength) {
destination.push(words);
return destination;
Expand All @@ -896,14 +896,14 @@ Client.prototype._splitLongLines = function(words, maxLength, destination) { //
var part = words.substring(0, cutPos);
destination.push(part);
return this._splitLongLines(words.substring(cutPos + 1, words.length), maxLength, destination);
}; // }}}
Client.prototype.say = function(target, text) { // {{{
};
Client.prototype.say = function(target, text) {
this._speak('PRIVMSG', target, text);
}; // }}}
Client.prototype.notice = function(target, text) { // {{{
};
Client.prototype.notice = function(target, text) {
this._speak('NOTICE', target, text);
}; // }}}
Client.prototype._speak = function(kind, target, text) { // {{{
};
Client.prototype._speak = function(kind, target, text) {
var self = this;
var maxLength = this.maxLineLength - target.length;
if (typeof text !== 'undefined') {
Expand All @@ -919,8 +919,8 @@ Client.prototype._speak = function(kind, target, text) { // {{{
});
});
}
}; // }}}
Client.prototype.whois = function(nick, callback) { // {{{
};
Client.prototype.whois = function(nick, callback) {
if (typeof callback === 'function') {
var callbackWrapper = function(info) {
if (info.nick == nick) {
Expand All @@ -931,24 +931,24 @@ Client.prototype.whois = function(nick, callback) { // {{{
this.addListener('whois', callbackWrapper);
}
this.send('WHOIS', nick);
}; // }}}
Client.prototype.list = function() { // {{{
};
Client.prototype.list = function() {
var args = Array.prototype.slice.call(arguments, 0);
args.unshift('LIST');
this.send.apply(this, args);
}; // }}}
Client.prototype._addWhoisData = function(nick, key, value, onlyIfExists) { // {{{
};
Client.prototype._addWhoisData = function(nick, key, value, onlyIfExists) {
if (onlyIfExists && !this._whoisData[nick]) return;
this._whoisData[nick] = this._whoisData[nick] || {nick: nick};
this._whoisData[nick][key] = value;
}; // }}}
Client.prototype._clearWhoisData = function(nick) { // {{{
};
Client.prototype._clearWhoisData = function(nick) {
// Ensure that at least the nick exists before trying to return
this._addWhoisData(nick, 'nick', nick);
var data = this._whoisData[nick];
delete this._whoisData[nick];
return data;
}; // }}}
};
Client.prototype._handleCTCP = function(from, to, text, type, message) {
text = text.slice(1);
text = text.slice(0, text.indexOf('\u0001'));
Expand Down Expand Up @@ -978,7 +978,7 @@ Client.prototype._updateMaxLineLength = function() {
* takes a raw "line" from the IRC server and turns it into an object with
* useful keys
*/
function parseMessage(line, stripColors) { // {{{
function parseMessage(line, stripColors) {
var message = {};
var match;

Expand Down Expand Up @@ -1034,6 +1034,6 @@ function parseMessage(line, stripColors) { // {{{
message.args.push(trailing);

return message;
} // }}}
}

exports.parseMessage = parseMessage;

0 comments on commit 9ce8133

Please sign in to comment.