added basic ssl support to ircu
[ircu2.10.12-pk.git] / ircd / m_opmode.c
index aab68f51d22e7a1e0379a8612cb822a1637d7e51..829b32323db7a347bcd80a44cc859ef1b7309967 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * IRC - Internet Relay Chat, ircd/m_tmpl.c
+ * IRC - Internet Relay Chat, ircd/m_opmode.c
  * Copyright (C) 1990 Jarkko Oikarinen and
  *                    University of Oulu, Computing Center
  * Copyright (C) 2000 Kevin L. Mitchell <klmitch@mit.edu>
 #include "hash.h"
 #include "ircd.h"
 #include "ircd_features.h"
+#include "ircd_log.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "msg.h"
 #include "numeric.h"
 #include "numnicks.h"
 #include "send.h"
+#include "s_conf.h"
 
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 
 /*
  * ms_opmode - server message handler
@@ -138,9 +140,9 @@ int mo_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 {
   struct Channel *chptr = 0;
   struct ModeBuf mbuf;
-  char *chname, *qreason;
+  char *chname;
+  const char *qreason;
   int force = 0;
-  struct Membership *member;
 
   if (!feature_bool(FEAT_CONFIG_OPERCMDS))
     return send_reply(sptr, ERR_DISABLED, "OPMODE");
@@ -152,11 +154,11 @@ int mo_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (*chname == '!')
   {
     chname++;
-    if (!HasPriv(sptr, IsLocalChannel(chname) ? PRIV_FORCE_LOCAL_OPMODE : PRIV_FORCE_OPMODE))
+    if (!HasPriv(sptr, IsLocalChannel(chname) ? PRIV_FORCE_LOCAL_OPMODE
+                                              : PRIV_FORCE_OPMODE))
       return send_reply(sptr, ERR_NOPRIVILEGES);
     force = 1;
   }
-  clean_channelname(chname);
 
   if (!HasPriv(sptr,
               IsLocalChannel(chname) ? PRIV_LOCAL_OPMODE : PRIV_OPMODE))
@@ -165,8 +167,8 @@ int mo_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (!IsChannelName(chname) || !(chptr = FindChannel(chname)))
     return send_reply(sptr, ERR_NOSUCHCHANNEL, chname);
 
-  if (!(member = find_member_link(chptr, sptr)))
-    return send_reply(sptr, ERR_NOTONCHANNEL, chptr->chname);
+  if (!force && (qreason = find_quarantine(chptr->chname)))
+    return send_reply(sptr, ERR_QUARANTINED, chptr->chname, qreason);
 
   modebuf_init(&mbuf, sptr, cptr, chptr,
               (MODEBUF_DEST_CHANNEL | /* Send MODE to channel */