]> PatchyGit - patchyircd.git/commitdiff
Blind commit lol - Added 421
authorSam Smith <sam@patchysicp.xyz>
Sun, 1 May 2022 04:04:40 +0000 (21:04 -0700)
committerSam Smith <sam@patchysicp.xyz>
Sun, 1 May 2022 04:04:40 +0000 (21:04 -0700)
irc.c

diff --git a/irc.c b/irc.c
index 91f0dee..a62c20f 100644 (file)
--- a/irc.c
+++ b/irc.c
@@ -75,7 +75,13 @@ int processPacket(struct client_data *client) {
        } else if(strncmp(packet, "PONG", 4) == 0) {
                // Do nothing
        } else {
-               printf("Unknown packet: %s\n", packet);
+               printf("Unknown packet: %s", packet);
+               // Inform user of error
+               append_str(&databuf, ":irc.patchysicp.xyz 421 ");
+               append_str(&databuf, client->nick);
+               append_str(&databuf, " :Unknown command, ");
+               append_str(&databuf, packet);
+               send_log(client->FD, databuf.buf, databuf.len, 0);
                fflush(stdout);
        }
        // End GitHub Copilot