Request names on mode change as a temporary measure

This commit is contained in:
Pavel Djundik 2016-03-16 22:54:11 +02:00 committed by Maxime Poulin
parent db5fe00b60
commit 17bcc37b80
2 changed files with 17 additions and 1 deletions

View File

@ -4,10 +4,14 @@ module.exports = function(irc, network) {
var client = this;
irc.on("irc_error", function(data) {
console.log(data);
var text = data.error;
if (data.reason) {
text = data.reason + " (" + text + ")";
}
var lobby = network.channels[0];
var msg = new Msg({
type: Msg.Type.ERROR,
text: data.error,
text: text,
});
client.emit("msg", {
chan: lobby.id,

View File

@ -16,11 +16,18 @@ module.exports = function(irc, network) {
}
}
var usersUpdated;
for (var i = 0; i < data.modes.length; i++) {
var mode = data.modes[i];
var text = mode.mode;
if (mode.param) {
text += " " + mode.param;
var user = _.find(targetChan.users, {name: mode.param});
if (typeof user !== "undefined") {
usersUpdated = true;
}
}
var msg = new Msg({
@ -37,5 +44,10 @@ module.exports = function(irc, network) {
msg: msg,
});
}
if (usersUpdated) {
// TODO: This is horrible
irc.raw("NAMES", data.target);
}
});
};