assert(Client != NULL);
assert(Req != NULL);
- _IRC_ARGC_GE_OR_RETURN_(Client, Req, 1)
_IRC_GET_SENDER_OR_RETURN_(origin, Req, Client)
/* Channel or user mode? */
else
x[0] = 'B';
break;
- case 'c': /* Receive connect notices
- * (only settable by IRC operators!) */
+ case 'c': /* Receive connect notices */
+ case 'q': /* KICK-protected user */
+ /* (only settable by IRC operators!) */
if (!set || Client_Type(Client) == CLIENT_SERVER
- || Client_OperByMe(Origin))
- x[0] = 'c';
+ || Client_HasMode(Origin, 'o'))
+ x[0] = *mode_ptr;
else
ok = IRC_WriteErrClient(Origin,
ERR_NOPRIVILEGES_MSG,
break;
case 'o': /* IRC operator (only unsettable!) */
if (!set || Client_Type(Client) == CLIENT_SERVER) {
- Client_SetOperByMe(Target, false);
x[0] = 'o';
} else
ok = IRC_WriteErrClient(Origin,
ERR_NOPRIVILEGES_MSG,
Client_ID(Origin));
break;
- case 'q': /* KICK-protected user */
- if (!set || Client_Type(Client) == CLIENT_SERVER
- || Client_OperByMe(Origin))
- x[0] = 'q';
- else
- ok = IRC_WriteErrClient(Origin,
- ERR_NOPRIVILEGES_MSG,
- Client_ID(Origin));
- break;
case 'r': /* Restricted (only settable) */
if (set || Client_Type(Client) == CLIENT_SERVER)
x[0] = 'r';
Client_ID(Origin));
else if (!set || Conf_CloakHostModeX[0]
|| Client_Type(Client) == CLIENT_SERVER
- || Client_OperByMe(Client)) {
+ || Client_HasMode(Origin, 'o')) {
x[0] = 'x';
send_RPL_HOSTHIDDEN_MSG = true;
} else
/* Check if origin is oper and opers can use mode */
use_servermode = Conf_OperServerMode;
- if(Client_OperByMe(Client) && Conf_OperCanMode) {
+ if(Client_HasMode(Client, 'o') && Conf_OperCanMode) {
is_oper = true;
}
#ifdef STRICT_RFC
/* Only send error message in "strict" mode,
* this is how ircd2.11 and others behave ... */
+ IRC_SetPenalty(Origin, 2);
connected = IRC_WriteErrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
#ifdef STRICT_RFC
/* Only send error message in "strict" mode,
* this is how ircd2.11 and others behave ... */
+ IRC_SetPenalty(Origin, 2);
connected = IRC_WriteErrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
* mode, because most other servers don't do
* it as well and some clients send "wired"
* MODE commands like "MODE #chan -ooo nick". */
+ IRC_SetPenalty(Origin, 2);
connected = IRC_WriteErrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
assert (Client != NULL);
assert (Req != NULL);
- _IRC_ARGC_LE_OR_RETURN_(Client, Req, 1)
-
if (Req->argc == 1 && Req->argv[0][0]) {
Client_SetAway(Client, Req->argv[0]);
Client_ModeAdd(Client, 'a');