#include "messages.h"
#include "conf.h"
+#include "irc-mode.h"
+
static bool Client_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin,
CLIENT *Target));
static bool Channel_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin,
_IRC_GET_SENDER_OR_RETURN_(origin, Req, Client)
+ /* Test for "fake" MODE commands injected by this local instance,
+ * for example when handling the "DefaultUserModes" settings.
+ * This doesn't harm real commands, because prefixes of regular
+ * clients are checked in Validate_Prefix() and can't be faked. */
+ if (Req->prefix && Client_Search(Req->prefix) == Client_ThisServer())
+ Client = Client_Search(Req->prefix);
+
/* Channel or user mode? */
cl = NULL; chan = NULL;
if (Client_IsValidNick(Req->argv[0]))
break;
case 'c': /* Receive connect notices */
case 'q': /* KICK-protected user */
+ case 'F': /* disable flood protection */
/* (only settable by IRC operators!) */
if (!set || Client_Type(Client) == CLIENT_SERVER
|| Client_HasMode(Origin, 'o'))