Handle invites

Requires irc-fw update
This commit is contained in:
Pavel Djundik 2016-03-26 01:26:53 +02:00 committed by Maxime Poulin
parent 3fc7036d32
commit 142aa85548
2 changed files with 7 additions and 8 deletions

View file

@ -3,7 +3,7 @@ invited
{{#if invitedYou}}
you
{{else}}
<a href="#" class="user" data-name="{{target}}">{{target}}</a>
<a href="#" class="user" data-name="{{invited}}">{{invited}}</a>
{{/if}}
to
{{{parse text}}}
{{{parse channel}}}

View file

@ -3,8 +3,6 @@ var Msg = require("../../models/msg");
module.exports = function(irc, network) {
var client = this;
irc.on("invite", function(data) {
var target = data.to;
var chan = network.getChannel(data.channel);
if (typeof chan === "undefined") {
chan = network.channels[0];
@ -12,10 +10,11 @@ module.exports = function(irc, network) {
var msg = new Msg({
type: Msg.Type.INVITE,
from: data.from,
target: target,
text: data.channel,
invitedYou: target === irc.user.nick
time: data.time,
from: data.nick,
invited: data.invited,
channel: data.channel,
invitedYou: data.invited === irc.user.nick
});
chan.messages.push(msg);
client.emit("msg", {