this.send = this.connection.send.bind(this.connection);
this.connect = this.connection.connect.bind(this.connection);
this.disconnect = this.connection.disconnect.bind(this.connection);
+
+ this.setupGenericErrors();
},
dispatch: function(data) {
var message = data[0];
return this.whois(nick, "end", {});
},
- irc_ERR_NOSUCHNICK: function(prefix, params) {
- var nick = params[1];
+ irc_generic_error: function(prefix, params) {
+ var target = params[1];
+ var message = params.indexFromEnd(-1);
- return this.whois(nick, "nosuchnick", {});
+ this.genericerror(target, message);
+ return true;
+ },
+ setupGenericErrors: function() {
+ this.irc_ERR_NOSUCHNICK = this.irc_ERR_CANNOTSENDTOCHAN = this.irc_generic_error;
+ return true;
},
irc_RPL_AWAY: function(prefix, params) {
var nick = params[1];
ndata.x = data.ip;
} else if(type == "end") {
mtype = "END";
- } else if(type == "nosuchnick") {
- mtype = "NOSUCHNICK";
} else {
return false;
}
xsend();
return true;
+ },
+ genericerror: function(target, message) {
+ this.newTargetOrActiveLine(target, "GENERICERROR", {m: message, t: target});
}
});
"338": "RPL_WHOISACTUALLY",
"343": "RPL_WHOISOPERNAME",
"301": "RPL_AWAY",
- "401": "ERR_NOSUCHNICK"
+ "401": "ERR_NOSUCHNICK",
+ "404": "ERR_CANNOTSENDTOCHAN"
};
"WHOISACTUALLY": [" realhost : $m [ip: $x]", true],
"WHOISEND": ["End of WHOIS", true],
"AWAY": ["$n is away: $m", true],
- "WHOISNOSUCHNICK": ["No such nick: $n", true]
+ "GENERICERROR": ["$m: $t", true]
};
qwebirc.ui.Theme = new Class({