mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-02 13:52:17 +02:00
30 lines
591 B
TypeScript
30 lines
591 B
TypeScript
"use strict";
|
|
|
|
import Network from "../../models/network";
|
|
|
|
import Msg from "../../models/msg";
|
|
|
|
export default <IrcEventHandler>function (irc, network) {
|
|
const client = this;
|
|
|
|
irc.on("loggedin", (data) => {
|
|
const lobby = network.channels[0];
|
|
|
|
const msg = new Msg({
|
|
type: MessageType.LOGIN,
|
|
text: "Logged in as: " + data.account,
|
|
});
|
|
lobby.pushMessage(client, msg, true);
|
|
});
|
|
|
|
irc.on("loggedout", () => {
|
|
const lobby = network.channels[0];
|
|
|
|
const msg = new Msg({
|
|
type: MessageType.LOGOUT,
|
|
text: "Logged out",
|
|
});
|
|
lobby.pushMessage(client, msg, true);
|
|
});
|
|
};
|