]> PatchyGit - patchyircd.git/commitdiff
add invite-notify cap
authorEgor <egor@patchysicp.xyz>
Fri, 3 Feb 2023 18:52:53 +0000 (20:52 +0200)
committerEgor <egor@patchysicp.xyz>
Fri, 3 Feb 2023 18:52:53 +0000 (20:52 +0200)
common.h
irc.c
ircfmt.c

index 5e0ecf5..2649905 100644 (file)
--- 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 (file)
--- 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;
index 2b68bc8..d064d07 100644 (file)
--- 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",