thelounge/server/plugins/irc-events/sasl.ts
2024-05-04 12:29:57 +02:00

28 lines
631 B
TypeScript

import {IrcEventHandler} from "../../client";
import Msg from "../../models/msg";
import {MessageType} from "../../../shared/types/msg";
export default <IrcEventHandler>function (irc, network) {
const client = this;
irc.on("loggedin", (data) => {
const lobby = network.getLobby();
const msg = new Msg({
type: MessageType.LOGIN,
text: "Logged in as: " + data.account,
});
lobby.pushMessage(client, msg, true);
});
irc.on("loggedout", () => {
const lobby = network.getLobby();
const msg = new Msg({
type: MessageType.LOGOUT,
text: "Logged out",
});
lobby.pushMessage(client, msg, true);
});
};