* note: it is guaranteed that parv[0]..parv[parc-1] are all
* non-NULL pointers.
*/
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
+#include "config.h"
+
#include "client.h"
#include "channel.h"
#include "hash.h"
#include "ircd.h"
+#include "ircd_features.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include "msg.h"
mode_parse(&mbuf, cptr, sptr, chptr, parc - 2, parv + 2,
(MODE_PARSE_SET | /* Set the modes on the channel */
MODE_PARSE_STRICT | /* Be strict about it */
- MODE_PARSE_FORCE)); /* And force them to be accepted */
+ MODE_PARSE_FORCE), /* And force them to be accepted */
+ NULL);
modebuf_flush(&mbuf); /* flush the modes */
*/
int mo_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
-#ifndef CONFIG_OPERCMDS
- return send_reply(sptr, ERR_DISABLED, "OPMODE");
-#else
struct Channel *chptr = 0;
struct ModeBuf mbuf;
struct Membership *member;
+ if (!feature_bool(FEAT_CONFIG_OPERCMDS))
+ return send_reply(sptr, ERR_DISABLED, "OPMODE");
+
if (parc < 3)
return need_more_params(sptr, "OPMODE");
clean_channelname(parv[1]);
+ if (!HasPriv(sptr,
+ IsLocalChannel(parv[1]) ? PRIV_LOCAL_OPMODE : PRIV_OPMODE))
+ return send_reply(sptr, ERR_NOPRIVILEGES);
+
if (('#' != *parv[1] && '&' != *parv[1]) || !(chptr = FindChannel(parv[1])))
return send_reply(sptr, ERR_NOSUCHCHANNEL, parv[1]);
mode_parse(&mbuf, cptr, sptr, chptr, parc - 2, parv + 2,
(MODE_PARSE_SET | /* set the modes on the channel */
- MODE_PARSE_FORCE)); /* And force them to be accepted */
+ MODE_PARSE_FORCE), /* And force them to be accepted */
+ NULL);
modebuf_flush(&mbuf); /* flush the modes */
return 0;
-#endif /* CONFIG_OPERCMDS */
}