Implement the "invite-notify" capability, making use of Quassel's
existing "invite" handling to display an invite message. Update the
Invite stringification to distinguish between an invite targeting the
current user vs. targeting some other nickname.
In the future, Quassel should make some sort of fancy invite
notification interface. This still provides a benefit through
standardization of existing notices.
See https://ircv3.net/specs/extensions/invite-notify-3.2
*/
const QString EXTENDED_JOIN = "extended-join";
*/
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
*
/**
* Additional metadata on a per-message basis
*
CAP_NOTIFY,
CHGHOST,
EXTENDED_JOIN,
CAP_NOTIFY,
CHGHOST,
EXTENDED_JOIN,
MESSAGE_TAGS,
MULTI_PREFIX,
SASL,
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 CoreSessionEventProcessor::processIrcEventInvite(IrcEvent* e)
{
if (checkParamCount(e, 2)) {
void EventStringifier::processIrcEventInvite(IrcEvent* e)
{
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)
}
void EventStringifier::processIrcEventJoin(IrcEvent* e)