Merge pull request #122 from xPaw/odd-invite
Fix #116: Move 'you' handling in invites to the client
This commit is contained in:
commit
325739c8be
@ -1,5 +1,9 @@
|
||||
<a href="#" class="user">{{from}}</a>
|
||||
invited
|
||||
{{#if invitedYou}}
|
||||
you
|
||||
{{else}}
|
||||
<a href="#" class="user">{{target}}</a>
|
||||
{{/if}}
|
||||
to
|
||||
{{{parse text}}}
|
||||
|
@ -5,9 +5,6 @@ module.exports = function(irc, network) {
|
||||
var client = this;
|
||||
irc.on("invite", function(data) {
|
||||
var target = data.to;
|
||||
if (target.toLowerCase() === irc.me.toLowerCase()) {
|
||||
target = "you";
|
||||
}
|
||||
|
||||
var chan = _.find(network.channels, {name: data.channel});
|
||||
if (typeof chan === "undefined") {
|
||||
@ -18,7 +15,8 @@ module.exports = function(irc, network) {
|
||||
type: Msg.Type.INVITE,
|
||||
from: data.from,
|
||||
target: target,
|
||||
text: data.channel
|
||||
text: data.channel,
|
||||
invitedYou: target.toLowerCase() === irc.me.toLowerCase()
|
||||
});
|
||||
chan.messages.push(msg);
|
||||
client.emit("msg", {
|
||||
|
Loading…
Reference in New Issue
Block a user