mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 20:13:07 +00:00
fade6a8d2e
This documents what we actually want and allows us to shift the logic to the network
23 lines
483 B
TypeScript
23 lines
483 B
TypeScript
import {IrcEventHandler} from "../../client";
|
|
|
|
import Msg from "../../models/msg";
|
|
|
|
export default <IrcEventHandler>function (irc, network) {
|
|
const client = this;
|
|
|
|
irc.on("registered", function (data) {
|
|
network.setNick(data.nick);
|
|
|
|
const lobby = network.getLobby();
|
|
const msg = new Msg({
|
|
text: "You're now known as " + data.nick,
|
|
});
|
|
lobby.pushMessage(client, msg);
|
|
|
|
client.save();
|
|
client.emit("nick", {
|
|
network: network.uuid,
|
|
nick: data.nick,
|
|
});
|
|
});
|
|
};
|