summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-05-24 01:32:00 +0100
committerGitHub <noreply@github.com>2021-05-23 19:32:00 -0500
commitc06f6f2565513089462ba2c627457e66ff637be9 (patch)
treee5fc6119a2031d5e0405224bd0e7f0a4e9856c84
parente4fd69e3d4ec2eb707a693ea69b8e14181249d0a (diff)
Implement support for the IRCv3 invite-notify specification. (#2574)
-rw-r--r--src/common/inbound.c1
-rw-r--r--src/common/proto-irc.c11
-rw-r--r--src/common/text.c7
-rw-r--r--src/common/textevents.in6
4 files changed, 20 insertions, 5 deletions
diff --git a/src/common/inbound.c b/src/common/inbound.c
index a7cf51a4..3a26dce9 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -1725,6 +1725,7 @@ static const char * const supported_caps[] = {
"cap-notify",
"chghost",
"setname",
+ "invite-notify",
/* ZNC */
"znc.in/server-time-iso",
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index e3f4a962..57eda88a 100644
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -1165,13 +1165,14 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
case WORDL('I','N','V','I'):
if (ignore_check (word[1], IG_INVI))
return;
-
- if (word[4][0] == ':')
- EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITED, sess, word[4] + 1, nick,
- serv->servername, NULL, 0,
+
+ text = STRIP_COLON(word, word_eol, 4);
+ if (serv->p_cmp (word[3], serv->nick))
+ EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITEDOTHER, sess, text, nick,
+ word[3], serv->servername, 0,
tags_data->timestamp);
else
- EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITED, sess, word[4], nick,
+ EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITED, sess, text, nick,
serv->servername, NULL, 0,
tags_data->timestamp);
diff --git a/src/common/text.c b/src/common/text.c
index 4a274f98..b0a90e03 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -1295,6 +1295,13 @@ static char * const pevt_invited_help[] = {
N_("Server Name"),
};
+static char * const pevt_invitedother_help[] = {
+ N_("Channel Name"),
+ N_("Nick of person who sent the invite"),
+ N_("Nick of person who was invited"),
+ N_("Server Name"),
+};
+
static char * const pevt_usersonchan_help[] = {
N_("Channel Name"),
N_("Users"),
diff --git a/src/common/textevents.in b/src/common/textevents.in
index 9790c18d..14bd4b06 100644
--- a/src/common/textevents.in
+++ b/src/common/textevents.in
@@ -496,6 +496,12 @@ pevt_invited_help
%C24*%O$tYou have been invited to %C22$1%O by %C18$2%O (%C29$3%O)
3
+Invited Other
+XP_TE_INVITEDOTHER
+pevt_invitedother_help
+%C24*%O$t%C26$3%C has been invited to %C22$1%O by %C18$2%O (%C29$4%O)
+4
+
Join
XP_TE_JOIN
pevt_join_help