mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 22:10:22 +00:00
28 lines
530 B
JavaScript
28 lines
530 B
JavaScript
|
"use strict";
|
||
|
|
||
|
const Msg = require("../../models/msg");
|
||
|
|
||
|
module.exports = function (irc, network) {
|
||
|
const client = this;
|
||
|
|
||
|
irc.on("loggedin", (data) => {
|
||
|
const lobby = network.channels[0];
|
||
|
|
||
|
const msg = new Msg({
|
||
|
type: Msg.Type.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: Msg.Type.LOGOUT,
|
||
|
text: "Logged out",
|
||
|
});
|
||
|
lobby.pushMessage(client, msg, true);
|
||
|
});
|
||
|
};
|