mirror of
https://github.com/thelounge/thelounge
synced 2024-11-27 22:40:23 +00:00
28 lines
631 B
TypeScript
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);
|
|
});
|
|
};
|