Prechádzať zdrojové kódy

* Added FR_ANYCH

svn: 1293
Bryan Drewery 22 rokov pred
rodič
commit
84a7998db2
3 zmenil súbory, kde vykonal 11 pridanie a 11 odobranie
  1. 2 1
      src/cmds.c
  2. 6 8
      src/flags.c
  3. 3 2
      src/flags.h

+ 2 - 1
src/cmds.c

@@ -750,13 +750,14 @@ static void cmd_help(int idx, char *par)
 {
   char flg[100] = "", *fcats = NULL, temp[100] = "", buf[2046] = "", match[20] = "";
   int fnd = 0, done = 0, nowild = 0;
-  struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0 };
+  struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYCH, 0, 0, 0 };
 
   egg_snprintf(temp, sizeof temp, "a|- a|a n|- n|n m|- m|m mo|o m|o i|- o|o o|- p|- -|-");
   fcats = temp;
 
   putlog(LOG_CMDS, "*", "#%s# help %s", dcc[idx].nick, par);
   get_user_flagrec(dcc[idx].user, &fr, NULL);
+
   build_flags(flg, &fr, NULL);
   if (!par[0]) {
     sprintf(match, "*");

+ 6 - 8
src/flags.c

@@ -107,7 +107,7 @@ geticon(int idx)
 
   if (!dcc[idx].user)
     return '-';
-  get_user_flagrec(dcc[idx].user, &fr, 0);
+  get_user_flagrec(dcc[idx].user, &fr, NULL);
   if (glob_admin(fr))
     return '^';
   if (chan_owner(fr))
@@ -228,10 +228,6 @@ build_flags(char *string, struct flag_record *plus, struct flag_record *minus)
     }
   }
   if (plus->match & FR_CHAN) {
-/* FIXME: BLAH */
-/*    if (plus->match & (FR_GLOBAL | FR_BOT))
-      *string++ = (plus->match & FR_AND) ? '&' : '|';
-*/
     if (plus->match & FR_GLOBAL)
       *string++ = (plus->match & FR_AND) ? '&' : '|';
 
@@ -369,12 +365,14 @@ get_user_flagrec(struct userrec *u, struct flag_record *fr, const char *chname)
   }
 
   if (fr->match & FR_CHAN) {
-    if (fr->match & FR_ANYWH) {
-      fr->chan = u->flags;
-      for (cr = u->chanrec; cr; cr = cr->next)
+    if ((fr->match & FR_ANYWH) || (fr->match & FR_ANYCH)) {
+      if (fr->match & FR_ANYWH)
+        fr->chan = u->flags;
+      for (cr = u->chanrec; cr; cr = cr->next) {
         if (findchan_by_dname(cr->channel)) {
           fr->chan |= cr->flags;
         }
+      }
     } else {
       if (chname) {
         for (cr = u->chanrec; cr; cr = cr->next) {

+ 3 - 2
src/flags.h

@@ -27,8 +27,9 @@ struct flag_record {
 #define FR_GLOBAL 0x00000001
 #define FR_CHAN   0x00000002
 #define FR_ANYWH  0x10000000
-#define FR_AND    0x20000000
-#define FR_OR     0x40000000
+#define FR_ANYCH  0x20000000
+#define FR_AND    0x40000000
+#define FR_OR     0x80000000
 
 /*
  * userflags: