From 3fb69d75341d5cf601b6aadf5b589b4602d45b75 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 15 Jun 2024 09:06:20 +0200 Subject: [PATCH] Send a single error when opping a non-existing nick This used to return both ERR_NOSUCHNICK and ERR_USERNOTINCHANNEL: C: MODE #chan +o nobody S: :My.Little.Server 401 chanop nobody :No such nick/channel S: :My.Little.Server 441 chanop nobody #chan :They aren't on that channel I changed it to return only ERR_NOSUCHNICK, like other IRCds do. --- src/channel.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/channel.c b/src/channel.c index af687ee4..481a54c8 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1972,6 +1972,11 @@ static int set_mode(aClient *cptr, aClient *sptr, aChannel *chptr, } who = find_chasing(sptr, parv[args], &chasing); + if(who == NULL) { + /* swallow the arg. don't send an error, find_chasing already did */ + args++; + break; + } cm = find_user_member(chptr->members, who); if(cm == NULL) {