Parcourir la source

* Rename FLOOD_EXEMPT_* flags to CHAN_FLAG_*

Bryan Drewery il y a 16 ans
Parent
commit
3805642301
4 fichiers modifiés avec 14 ajouts et 14 suppressions
  1. 3 3
      src/chan.h
  2. 1 1
      src/mod/channels.mod/cmdschan.c
  3. 5 5
      src/mod/channels.mod/tclchan.c
  4. 5 5
      src/mod/irc.mod/chan.c

+ 3 - 3
src/chan.h

@@ -23,9 +23,9 @@ typedef struct memstruct {
   char userip[UHOSTLEN];
 } memberlist;
 
-#define FLOOD_EXEMPT_OP	1
-#define FLOOD_EXEMPT_VOICE 2
-#define FLOOD_EXEMPT_USER 3
+#define CHAN_FLAG_OP	1
+#define CHAN_FLAG_VOICE 2
+#define CHAN_FLAG_USER 3
 
 #define CHANMETA "#&!+"
 #define NICKVALID "[{}]^`|\\_-"

+ 1 - 1
src/mod/channels.mod/cmdschan.c

@@ -1182,7 +1182,7 @@ static void show_int(int idx, char *work, int *cnt, const char *desc, int state,
 #define SHOW_FLAG(name, state) show_flag(idx, work, &cnt, name, state, sizeof(work))
 #define SHOW_INT(desc, state, yes, no) show_int(idx, work, &cnt, desc, state, yes, no, sizeof(work))
 #define P_STR deflag == P_KICK ? "Kick" : (deflag == P_DEOP ? "Deop" : (deflag == P_DELETE ? "Remove" : NULL))
-#define F_STR(x) x == FLOOD_EXEMPT_OP ? "Op" : (x == FLOOD_EXEMPT_VOICE ? "Voice" : (x == FLOOD_EXEMPT_USER ? "User" : NULL))
+#define F_STR(x) x == CHAN_FLAG_OP ? "Op" : (x == CHAN_FLAG_VOICE ? "Voice" : (x == CHAN_FLAG_USER ? "User" : NULL))
 static void cmd_chaninfo(int idx, char *par)
 {
   char *chname = NULL, work[512] = "";

+ 5 - 5
src/mod/channels.mod/tclchan.c

@@ -484,11 +484,11 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
       }
       if (!str_isdigit(item[i])) {
         if (!strcasecmp("Op",  item[i]))
-          chan->knock_flags = FLOOD_EXEMPT_OP;
+          chan->knock_flags = CHAN_FLAG_OP;
         else if (!strcasecmp("Voice", item[i]))
-          chan->knock_flags = FLOOD_EXEMPT_VOICE;
+          chan->knock_flags = CHAN_FLAG_VOICE;
         else if (!strcasecmp("User", item[i]))
-          chan->knock_flags = FLOOD_EXEMPT_USER;
+          chan->knock_flags = CHAN_FLAG_USER;
         else if (!strcasecmp("None", item[i]))
           chan->knock_flags = 0;
         else {
@@ -507,9 +507,9 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
       }
       if (!str_isdigit(item[i])) {
         if (!strcasecmp("Op",  item[i]))
-          chan->flood_exempt_mode = FLOOD_EXEMPT_OP;
+          chan->flood_exempt_mode = CHAN_FLAG_OP;
         else if (!strcasecmp("Voice", item[i]))
-          chan->flood_exempt_mode = FLOOD_EXEMPT_VOICE;
+          chan->flood_exempt_mode = CHAN_FLAG_VOICE;
         else if (!strcasecmp("None", item[i]))
           chan->flood_exempt_mode = 0;
         else {

+ 5 - 5
src/mod/irc.mod/chan.c

@@ -527,8 +527,8 @@ static bool detect_chan_flood(char *floodnick, char *floodhost, char *from,
        (glob_master(fr) || chan_master(fr))) ||
       ((which != FLOOD_DEOP) && (which != FLOOD_KICK) && 
        ( (chk_noflood(fr) || 
-         (m && chan->flood_exempt_mode == FLOOD_EXEMPT_OP && chan_hasop(m)) || 
-         (m && chan->flood_exempt_mode == FLOOD_EXEMPT_VOICE && (chan_hasvoice(m) || chan_hasop(m))) )
+         (m && chan->flood_exempt_mode == CHAN_FLAG_OP && chan_hasop(m)) ||
+         (m && chan->flood_exempt_mode == CHAN_FLAG_VOICE && (chan_hasvoice(m) || chan_hasop(m))) )
       )))
     return 0;
 
@@ -1642,9 +1642,9 @@ static int got710(char *from, char *msg)
   get_user_flagrec(u, &fr, chan->dname, chan);
 
   // PASSING: +o and op || +v and op/voice || user
-  if (!((chan->knock_flags == FLOOD_EXEMPT_OP && chk_op(fr, chan)) ||
-       (chan->knock_flags == FLOOD_EXEMPT_VOICE && (chk_op(fr, chan) || chk_voice(fr, chan))) ||
-       (chan->knock_flags == FLOOD_EXEMPT_USER)) ||
+  if (!((chan->knock_flags == CHAN_FLAG_OP && chk_op(fr, chan)) ||
+       (chan->knock_flags == CHAN_FLAG_VOICE && (chk_op(fr, chan) || chk_voice(fr, chan))) ||
+       (chan->knock_flags == CHAN_FLAG_USER)) ||
       chan_kick(fr) || glob_kick(fr)) {
     return 0;
   }