mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 22:10:22 +00:00
Request names on mode change as a temporary measure
This commit is contained in:
parent
db5fe00b60
commit
17bcc37b80
2 changed files with 17 additions and 1 deletions
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue