*/
const QString EXTENDED_JOIN = "extended-join";
+ /**
+ * Standardized invite notifications.
+ *
+ * https://ircv3.net/specs/extensions/invite-notify-3.2
+ */
+ const QString INVITE_NOTIFY = "invite-notify";
+
/**
* Additional metadata on a per-message basis
*
CAP_NOTIFY,
CHGHOST,
EXTENDED_JOIN,
+ INVITE_NOTIFY,
MESSAGE_TAGS,
MULTI_PREFIX,
SASL,
}
}
+// IRCv3 INVITE - ":<inviter> INVITE <target> <channel>"
+// Example: :ChanServ!ChanServ@example.com INVITE Attila #channel
+//
+// See https://ircv3.net/specs/extensions/invite-notify-3.2
void CoreSessionEventProcessor::processIrcEventInvite(IrcEvent* e)
{
if (checkParamCount(e, 2)) {
void EventStringifier::processIrcEventInvite(IrcEvent* e)
{
- displayMsg(e, Message::Invite, tr("%1 invited you to channel %2").arg(e->nick(), e->params().at(1)));
+ if (!checkParamCount(e, 2))
+ return;
+
+ // TODO: provide a nicer UI for invite notifications
+ QString target = e->params().at(0);
+ QString channel = e->params().at(1);
+ if (e->network()->isMyNick(target)) {
+ displayMsg(e, Message::Invite, tr("%1 invited you to channel %2").arg(e->nick(), channel));
+ }
+ else {
+ displayMsg(e, Message::Invite, tr("%1 invited %2 to channel %3").arg(e->nick(), target, channel));
+ }
}
void EventStringifier::processIrcEventJoin(IrcEvent* e)