Handle invites
Requires irc-fw update
This commit is contained in:
parent
3fc7036d32
commit
142aa85548
@ -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}}}
|
||||
|
@ -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", {
|
||||
|
Loading…
Reference in New Issue
Block a user