mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-27 17:50:24 +02:00
29 lines
527 B
JavaScript
29 lines
527 B
JavaScript
"use strict";
|
|
|
|
module.exports = function (irc, network) {
|
|
const client = this;
|
|
|
|
irc.on("userlist", function (data) {
|
|
const chan = network.getChannel(data.channel);
|
|
|
|
if (typeof chan === "undefined") {
|
|
return;
|
|
}
|
|
|
|
const newUsers = new Map();
|
|
|
|
data.users.forEach((user) => {
|
|
const newUser = chan.getUser(user.nick);
|
|
newUser.setModes(user.modes, network.prefixLookup);
|
|
|
|
newUsers.set(user.nick.toLowerCase(), newUser);
|
|
});
|
|
|
|
chan.users = newUsers;
|
|
|
|
client.emit("users", {
|
|
chan: chan.id,
|
|
});
|
|
});
|
|
};
|