]> PatchyGit - patchyircd.git/commitdiff
add GHOST command
authorEgor <egor@patchysicp.xyz>
Wed, 11 May 2022 20:23:23 +0000 (23:23 +0300)
committerEgor <egor@patchysicp.xyz>
Wed, 11 May 2022 20:23:23 +0000 (23:23 +0300)
irc.c

diff --git a/irc.c b/irc.c
index c400507..3be72f9 100644 (file)
--- a/irc.c
+++ b/irc.c
@@ -303,6 +303,15 @@ int processPacket(struct client_data *client, char *source, char *command, int a
                msg_notice_server(hostname, client->nick,
                                "Your information has been recorded. Contact IRCops for assistance with registration.");
                sendbuf(client);
+       } else if(strcmp(command, "GHOST") == 0) {
+               if (client->umode & UMODE_REGISTERED)
+                       return 0; // FIXME: error message
+               struct client_data *cl = findClient(client->username);
+               if (!cl)
+                       return 0; // FIXME: error message
+               if (client == cl)
+                       return 0; // FIXME: error message
+               killConnection(cl, false);
        } else if(strcmp(command, "JEDGAR") == 0) {
                if (!is_registered(client))
                        return err_notregistered(client), sendbuf(client), 0;