2016-10-09 15:14:02 -04:00
|
|
|
"use strict";
|
|
|
|
|
2016-02-12 06:24:13 -05:00
|
|
|
var Msg = require("../../models/msg");
|
|
|
|
|
|
|
|
module.exports = function(irc, network) {
|
|
|
|
var client = this;
|
|
|
|
irc.on("invite", function(data) {
|
2016-03-20 10:28:47 -04:00
|
|
|
var chan = network.getChannel(data.channel);
|
2016-02-12 06:24:13 -05:00
|
|
|
if (typeof chan === "undefined") {
|
|
|
|
chan = network.channels[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
var msg = new Msg({
|
|
|
|
type: Msg.Type.INVITE,
|
2016-03-25 19:26:53 -04:00
|
|
|
time: data.time,
|
|
|
|
from: data.nick,
|
|
|
|
invited: data.invited,
|
|
|
|
channel: data.channel,
|
2016-04-22 12:38:59 -04:00
|
|
|
highlight: true,
|
2016-03-25 19:26:53 -04:00
|
|
|
invitedYou: data.invited === irc.user.nick
|
2016-02-12 06:24:13 -05:00
|
|
|
});
|
2016-04-19 06:20:18 -04:00
|
|
|
chan.pushMessage(client, msg);
|
2016-02-12 06:24:13 -05:00
|
|
|
});
|
|
|
|
};
|