* 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 <assert.h>
#include <stdio.h>
case 'x': /* Cloak hostname */
if (Client_HasMode(Client, 'r'))
- IRC_WriteStrClient(Origin,
+ ok = IRC_WriteStrClient(Origin,
ERR_RESTRICTED_MSG,
Client_ID(Origin));
else
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