commit - 3b37ad334b6a7fbc5ca907e1af72efd3d3f8bd3b
commit + 66c6458ae7aa575c0a7a8250476472d59a155e28
blob - 8e08565030f4d5c91a77ea67ebdf948dce9e4aaa
blob + 9509fb012bc615114cc9cd7dff97adbabdf01ad0
--- src/ngircd/irc-mode.c
+++ src/ngircd/irc-mode.c
{
char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], x[2],
argadd[CLIENT_PASS_LEN], *mode_ptr;
- bool ok, set, modeok = true, skiponce, use_servermode = false, retval;
+ bool connected, set, modeok = true, skiponce, use_servermode = false, retval;
int mode_arg, arg_arg;
CLIENT *client;
long l;
the_args[0] = '\0';
x[1] = '\0';
- ok = CONNECTED;
+ connected = CONNECTED;
while (mode_ptr) {
if (!skiponce)
mode_ptr++;
if (modeok)
x[0] = *mode_ptr;
else
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_CHANOPRIVSNEEDED_MSG,
Client_ID(Origin), Channel_Name(Channel));
break;
if (modeok)
x[0] = *mode_ptr;
else
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_CHANOPRIVSNEEDED_MSG,
Client_ID(Origin),
Channel_Name(Channel));
sizeof(argadd));
x[0] = *mode_ptr;
} else {
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_CHANOPRIVSNEEDED_MSG,
Client_ID(Origin),
Channel_Name(Channel));
Req->argv[arg_arg][0] = '\0';
arg_arg++;
} else {
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
goto chan_exit;
if (modeok)
x[0] = *mode_ptr;
else
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_CHANOPRIVSNEEDED_MSG,
Client_ID(Origin),
Channel_Name(Channel));
x[0] = *mode_ptr;
}
} else {
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_CHANOPRIVSNEEDED_MSG,
Client_ID(Origin),
Channel_Name(Channel));
Req->argv[arg_arg][0] = '\0';
arg_arg++;
} else {
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
goto chan_exit;
* set the 'P' channel mode! */
if (set && !(Client_OperByMe(Client)
|| Client_Type(Client) == CLIENT_SERVER))
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_NOPRIVILEGES_MSG,
Client_ID(Origin));
else
x[0] = 'P';
} else
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_CHANOPRIVSNEEDED_MSG,
Client_ID(Origin),
Channel_Name(Channel));
if (client)
x[0] = *mode_ptr;
else
- ok = IRC_WriteStrClient(Client,
+ connected = IRC_WriteStrClient(Client,
ERR_NOSUCHNICK_MSG,
Client_ID(Client),
Req->argv[arg_arg]);
} else {
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_CHANOPRIVSNEEDED_MSG,
Client_ID(Origin),
Channel_Name(Channel));
Req->argv[arg_arg][0] = '\0';
arg_arg++;
} else {
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_NEEDMOREPARAMS_MSG,
Client_ID(Origin), Req->command);
goto chan_exit;
if (arg_arg > mode_arg) {
/* modify list */
if (modeok) {
- ok = set
+ connected = set
? Add_Ban_Invite(*mode_ptr, Origin,
Client, Channel,
Req->argv[arg_arg])
Client, Channel,
Req->argv[arg_arg]);
} else {
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_CHANOPRIVSNEEDED_MSG,
Client_ID(Origin),
Channel_Name(Channel));
set ? '+' : '-', *mode_ptr, Client_ID(Origin),
Channel_Name(Channel));
if (Client_Type(Client) != CLIENT_SERVER)
- ok = IRC_WriteStrClient(Origin,
+ connected = IRC_WriteStrClient(Origin,
ERR_UMODEUNKNOWNFLAG2_MSG,
Client_ID(Origin),
set ? '+' : '-', *mode_ptr);
goto chan_exit;
} /* switch() */
- if (!ok)
+ if (!connected)
break;
/* Is there a valid mode change? */
if (use_servermode)
Origin = Client_ThisServer();
/* Send reply to client and inform other servers and channel users */
- ok = IRC_WriteStrClientPrefix(Client, Origin,
+ connected = IRC_WriteStrClientPrefix(Client, Origin,
"MODE %s %s%s", Channel_Name(Channel),
the_modes, the_args);
/* Only forward requests for non-local channels */
}
IRC_SetPenalty(Client, 1);
- return CONNECTED;
+ return connected;
} /* Channel_Mode */