diff --git a/client/views/actions/invite.tpl b/client/views/actions/invite.tpl
index 52f2c0a9..1f3a7750 100644
--- a/client/views/actions/invite.tpl
+++ b/client/views/actions/invite.tpl
@@ -1,5 +1,9 @@
{{from}}
invited
-{{target}}
+{{#if invitedYou}}
+ you
+{{else}}
+ {{target}}
+{{/if}}
to
{{{parse text}}}
diff --git a/src/plugins/irc-events/invite.js b/src/plugins/irc-events/invite.js
index 3ff3ac5b..6bf1e3b7 100644
--- a/src/plugins/irc-events/invite.js
+++ b/src/plugins/irc-events/invite.js
@@ -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", {