]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/chmode.c
chmode: Remove chm_regonly, a vestige from ratbox which doesn't apply to native chary...
[irc/rqf/shadowircd.git] / src / chmode.c
index 4c86b3da4ba13eb55998582576aedf22f417099f..d5fa3a315ddbc96eefac9216acd21498100a67cd 100644 (file)
@@ -660,6 +660,7 @@ chm_hidden(struct Client *source_p, struct Channel *chptr,
        if(MyClient(source_p) && (++mode_limit_simple > MAXMODES_SIMPLE))
                return;
 
+
        /* setting + */
        if((dir == MODE_ADD) && !(chptr->mode.mode & mode_type))
        {
@@ -673,6 +674,19 @@ chm_hidden(struct Client *source_p, struct Channel *chptr,
                mode_changes[mode_count].mems = ONLY_OPERS;
                mode_changes[mode_count].override = 0;
                mode_changes[mode_count++].arg = NULL;
+       
+               /* A little ugly */
+               sendto_wallops_flags(UMODE_WALLOP, &me, 
+                               "+%c set on [%s] by %s!%s@%s",
+                               c, chptr->chname, source_p->name, source_p->username, source_p->host);
+               ilog(L_MAIN, "+%c set on [%s] by %s",
+                               c, chptr->chname, get_oper_name(source_p));
+
+               if(*chptr->chname != '&')
+                       sendto_server(NULL, NULL, NOCAPS, NOCAPS, 
+                               ":%s WALLOPS :+%c set on [%s] by %s!%s@%s",
+                               me.name, c, chptr->chname, source_p->name, source_p->username,
+                               source_p->host);
        }
        else if((dir == MODE_DEL) && (chptr->mode.mode & mode_type))
        {
@@ -686,6 +700,19 @@ chm_hidden(struct Client *source_p, struct Channel *chptr,
                mode_changes[mode_count].id = NULL;
                mode_changes[mode_count].override = 0;
                mode_changes[mode_count++].arg = NULL;
+               
+               /* A little ugly */
+               sendto_wallops_flags(UMODE_WALLOP, &me, 
+                               "+%c unset from [%s] by %s!%s@%s",
+                               c, chptr->chname, source_p->name, source_p->username, source_p->host);
+               ilog(L_MAIN, "+%c unset from [%s] by %s",
+                               c, chptr->chname, get_oper_name(source_p));
+
+               if(*chptr->chname != '&')
+                       sendto_server(NULL, NULL, NOCAPS, NOCAPS, 
+                               ":%s WALLOPS :+%c unset from [%s] by %s!%s@%s",
+                               me.name, c, chptr->chname, source_p->name, source_p->username,
+                               source_p->host);
        }
 }
 
@@ -1734,52 +1761,6 @@ chm_key(struct Client *source_p, struct Channel *chptr,
        }
 }
 
-void
-chm_regonly(struct Client *source_p, struct Channel *chptr,
-           int alevel, int parc, int *parn,
-           const char **parv, int *errors, int dir, char c, long mode_type)
-{
-       int override = 0;
-
-       if(alevel != CHFL_CHANOP && alevel != CHFL_ADMIN && alevel != CHFL_HALFOP)
-       {
-               if(IsOverride(source_p))
-                       override = 1;
-               else
-               {
-                       if(!(*errors & SM_ERR_NOOPS))
-                               sendto_one(source_p, form_str(ERR_CHANOPRIVSNEEDED),
-                                               me.name, source_p->name, chptr->chname);
-                       *errors |= SM_ERR_NOOPS;
-                       return;
-               }
-       }
-
-       if(dir == MODE_QUERY)
-               return;
-
-       if(((dir == MODE_ADD) && (chptr->mode.mode & mode_type)) ||
-          ((dir == MODE_DEL) && !(chptr->mode.mode & mode_type)))
-               return;
-
-       if(MyClient(source_p) && (++mode_limit_simple > MAXMODES_SIMPLE))
-               return;
-
-       if(dir == MODE_ADD)
-               chptr->mode.mode |= mode_type;
-       else
-               chptr->mode.mode &= ~mode_type;
-
-       mode_changes[mode_count].letter = c;
-       mode_changes[mode_count].dir = dir;
-       mode_changes[mode_count].caps = CAP_SERVICE;
-       mode_changes[mode_count].nocaps = 0;
-       mode_changes[mode_count].mems = ALL_MEMBERS;
-       mode_changes[mode_count].id = NULL;
-       mode_changes[mode_count].override = override;
-       mode_changes[mode_count++].arg = NULL;
-}
-
 /* *INDENT-OFF* */
 struct ChannelMode chmode_table[256] =
 {
@@ -1898,7 +1879,7 @@ struct ChannelMode chmode_table[256] =
   {chm_op,     0 },                    /* o */
   {chm_simple, MODE_PRIVATE },         /* p */
   {chm_ban,    CHFL_QUIET },           /* q */
-  {chm_regonly, MODE_REGONLY },                /* r */
+  {chm_simple, MODE_REGONLY },         /* r */
   {chm_simple, MODE_SECRET },          /* s */
   {chm_simple, MODE_TOPICLIMIT },      /* t */
   {chm_nosuch, 0 },                    /* u */