From: Egor Date: Fri, 3 Feb 2023 18:52:53 +0000 (+0200) Subject: add invite-notify cap X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=64ef2394c1dfa96d93c9237dd7be2214886bd7cc;p=patchyircd.git add invite-notify cap --- diff --git a/common.h b/common.h index 5e0ecf5..2649905 100644 --- a/common.h +++ b/common.h @@ -24,6 +24,7 @@ struct tls; #define CAP_MULTIPREFIX 2 #define CAP_EXTENDEDJOIN 4 #define CAP_AWAYNOTIFY 8 +#define CAP_INVITENOTIFY 16 struct client_data { SOCKET FD; struct tls *cctx; diff --git a/irc.c b/irc.c index df40c7e..85d9980 100644 --- a/irc.c +++ b/irc.c @@ -198,6 +198,7 @@ int processPacket(struct client_data *client, char *source, char *command, int a { "multi-prefix", CAP_MULTIPREFIX }, { "extended-join", CAP_EXTENDEDJOIN }, { "away-notify", CAP_AWAYNOTIFY }, + { "invite-notify", CAP_INVITENOTIFY }, { 0, 0 } }; @@ -207,7 +208,7 @@ int processPacket(struct client_data *client, char *source, char *command, int a if (strcmp(args[0], "LS") == 0) { if (args[1] && atoi(args[1]) >= 302) client->caps |= CAP_302; - copy_strf(&databuf, ":%s CAP * LS :multi-prefix extended-join away-notify\r\n", hostname); + copy_strf(&databuf, ":%s CAP * LS :multi-prefix extended-join away-notify invite-notify\r\n", hostname); sendbuf(client); if (!is_registered(client)) { client->regstate = REG_CAPLS; @@ -483,6 +484,7 @@ int processPacket(struct client_data *client, char *source, char *command, int a sendbuf(client); msg_invite(client, cl, chan); sendbuf(cl); + sendbuf_chan_caps(chan, CAP_INVITENOTIFY, 0); } else if(strcmp(command, "PRIVMSG") == 0 || strcmp(command, "NOTICE") == 0) { if (!is_registered(client)) return err_notregistered(client), sendbuf(client), 0; diff --git a/ircfmt.c b/ircfmt.c index 2b68bc8..d064d07 100644 --- a/ircfmt.c +++ b/ircfmt.c @@ -107,12 +107,12 @@ void msg_notice_server(const char *src, const char *dst, const char *msg) copy_strf(&databuf, ":%s NOTICE %s :%s\r\n", src, dst, msg); } -#if 0 void msg_kill(struct client_data *src, struct client_data *dst, const char *reason) { copy_strf(&databuf, ":%s!%s@%s KILL %s :%s\r\n", - src->nick, src->username, src->hostname, dst->nick, msg); + src->nick, src->username, src->hostname, dst->nick, reason); } +#if 0 void msg_wallops(struct client_data *src, const char *msg) { copy_strf(&databuf, ":%s!%s@%s WALLOPS :%s\r\n",