thelounge/server/plugins/irc-events/sasl.ts

29 lines
631 B
TypeScript
Raw Normal View History

import {IrcEventHandler} from "../../client";
2024-02-15 22:01:22 +00:00
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);
});
};