X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-mode.c;h=0df848f3943ee1a18c685f403898e353784014b2;hb=8f5cbe51a79c786be30ebc93466988cf67a825e1;hp=a51369f0086f189fba6f2ebf8a90db65a0f1ef26;hpb=888c52468373e3680fa1138830643848675779e5;p=ngircd-alex.git diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index a51369f0..0df848f3 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -54,7 +54,7 @@ static bool Send_ListChange PARAMS((const bool IsAdd, const char ModeChar, * Handler for the IRC "MODE" command. * * This function detects whether user or channel modes should be modified - * and calls the apropriate sub-functions. + * and calls the appropriate sub-functions. * * @param Client The client from which this command has been received. * @param Req Request structure with prefix and all parameters. @@ -354,7 +354,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) } if (send_RPL_HOSTHIDDEN_MSG && Client_Conn(Target) > NONE) { - /* A new (cloaked) hostname must be annoucned */ + /* A new (cloaked) hostname must be announced */ IRC_WriteStrClientPrefix(Target, Origin, RPL_HOSTHIDDEN_MSG, Client_ID(Target), @@ -436,7 +436,7 @@ static bool Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) { char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], x[2], - argadd[CLIENT_PASS_LEN], *mode_ptr, *o_mode_ptr; + argadd[CLIENT_PASS_LEN], *mode_ptr; bool connected, set, skiponce, retval, use_servermode, is_halfop, is_op, is_admin, is_owner, is_machine, is_oper; int mode_arg, arg_arg, mode_arg_count = 0; @@ -547,18 +547,14 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) arg_arg = -1; if(!is_machine && !is_oper) { - o_mode_ptr = Channel_UserModes(Channel, Client); - while( *o_mode_ptr ) { - if ( *o_mode_ptr == 'q') - is_owner = true; - if ( *o_mode_ptr == 'a') - is_admin = true; - if ( *o_mode_ptr == 'o') - is_op = true; - if ( *o_mode_ptr == 'h') - is_halfop = true; - o_mode_ptr++; - } + if (Channel_UserHasMode(Channel, Client, 'q')) + is_owner = true; + if (Channel_UserHasMode(Channel, Client, 'a')) + is_admin = true; + if (Channel_UserHasMode(Channel, Client, 'o')) + is_op = true; + if (Channel_UserHasMode(Channel, Client, 'h')) + is_halfop = true; } /* Validate modes */ @@ -1035,7 +1031,7 @@ Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel, } /** - * Delete entries from channel invite, ban and exeption lists. + * Delete entries from channel invite, ban and exception lists. * * @param what Can be 'I' for invite, 'b' for ban, and 'e' for exception list. * @param Prefix The originator of the command.