]> PatchyGit - patchyircd.git/commitdiff
irc: don't send error when changing nick to itself
authorEgor <egor@patchysicp.xyz>
Tue, 18 Mar 2025 19:24:03 +0000 (21:24 +0200)
committerEgor <egor@patchysicp.xyz>
Tue, 18 Mar 2025 19:24:03 +0000 (21:24 +0200)
src/irc.cpp

index ccd4006..fc54316 100644 (file)
@@ -1307,8 +1307,9 @@ void setNick(struct client_data *client, char* nickname) {
        stringlower(key);
 
        // TODO: make the cia nickname a define
-       if (!strcmp(key, "cia") || client_map.get(key)) {
-               err_nicknameinuse(client, nickname), sendbuf(client);
+       if (struct client_data *other = client_map.get(key); other || !strcmp(key, "cia")) {
+               if (client != other)
+                       err_nicknameinuse(client, nickname), sendbuf(client);
                return;
        }