From 2dfa24d2fa42bdfece472da57c823a3968230fae Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Mon, 1 Aug 2011 22:09:40 +0200 Subject: [PATCH] Handle unknown user modes on server links --- src/ngircd/irc-mode.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index 7861868d..b469a169 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -242,16 +242,25 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) x[0] = 'x'; break; default: - Log(LOG_DEBUG, "Unknown mode \"%c%c\" from \"%s\"!?", - set ? '+' : '-', *mode_ptr, Client_ID(Origin)); - if (Client_Type(Client) != CLIENT_SERVER) + if (Client_Type(Client) != CLIENT_SERVER) { + Log(LOG_DEBUG, + "Unknown mode \"%c%c\" from \"%s\"!?", + set ? '+' : '-', *mode_ptr, + Client_ID(Origin)); ok = IRC_WriteStrClient(Origin, ERR_UMODEUNKNOWNFLAG2_MSG, Client_ID(Origin), set ? '+' : '-', *mode_ptr); - x[0] = '\0'; - goto client_exit; + x[0] = '\0'; + goto client_exit; + } else { + Log(LOG_DEBUG, + "Handling unknown mode \"%c%c\" from \"%s\" for \"%s\" ...", + set ? '+' : '-', *mode_ptr, + Client_ID(Origin), Client_ID(Target)); + x[0] = *mode_ptr; + } } if (!ok)