X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-mode.c;h=50b0db0476cf4eab116d8192606843ac0c351fe2;hb=ae7470ceb546d87cbd366d508641276313ec9130;hp=1e6772a69e636a6288ecf1393cf8db96eff7df47;hpb=ba32d594fd7a93305cd01a14978971d948392510;p=ngircd-alex.git diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c index 1e6772a6..50b0db04 100644 --- a/src/ngircd/irc-mode.c +++ b/src/ngircd/irc-mode.c @@ -7,13 +7,15 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. - * - * IRC commands for mode changes (MODE, AWAY, ...) */ - #include "portab.h" +/** + * @file + * IRC commands for mode changes (like MODE, AWAY, etc.) + */ + #include "imp.h" #include #include @@ -202,7 +204,7 @@ Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target ) case 'x': /* Cloak hostname */ if (Client_HasMode(Client, 'r')) - IRC_WriteStrClient(Origin, + ok = IRC_WriteStrClient(Origin, ERR_RESTRICTED_MSG, Client_ID(Origin)); else @@ -499,6 +501,23 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) goto chan_exit; } break; + case 'O': /* IRC operators only */ + if (modeok) { + /* Only IRC operators are allowed to + * set the 'O' channel mode! */ + if (set && !(Client_OperByMe(Client) + || Client_Type(Client) == CLIENT_SERVER)) + connected = IRC_WriteStrClient(Origin, + ERR_NOPRIVILEGES_MSG, + Client_ID(Origin)); + else + x[0] = 'O'; + } else + connected = IRC_WriteStrClient(Origin, + ERR_CHANOPRIVSNEEDED_MSG, + Client_ID(Origin), + Channel_Name(Channel)); + break; case 'P': /* Persistent channel */ if (modeok) { /* Only IRC operators are allowed to