mirror of
https://github.com/thelounge/thelounge.git
synced 2024-05-08 09:16:45 +02:00
25 lines
497 B
TypeScript
25 lines
497 B
TypeScript
import {IrcEventHandler} from "../../client";
|
|
|
|
import Msg, {MessageType} from "../../models/msg";
|
|
|
|
export default <IrcEventHandler>function (irc, network) {
|
|
const client = this;
|
|
|
|
irc.on("account", function (data) {
|
|
network.channels.forEach((chan) => {
|
|
const user = chan.findUser(data.nick);
|
|
|
|
if (typeof user === "undefined") {
|
|
return;
|
|
}
|
|
|
|
user.account = data.account ? data.account : "";
|
|
chan.setUser(user);
|
|
|
|
client.emit("users", {
|
|
chan: chan.id,
|
|
});
|
|
});
|
|
});
|
|
};
|