m_join forward nicklist restriction & m_names manual nicklist restriction
[ircu2.10.12-pk.git] / ircd / m_join.c
index 3bc64b6e3fce267b742a116377ebd2671630267b..88681c75edcda1e428be9267f6aa212a015f104f 100644 (file)
@@ -157,7 +157,9 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
       send_reply(sptr, ERR_TOOMANYCHANNELS, name);
       break; /* no point processing the other channels */
     }
-
+    
+       int flags = 0;
+       
     /* BADCHANed channel */
     if ((gline = gline_find(name, GLINE_BADCHAN)) &&
        GlineIsActive(gline) && !IsAnOper(sptr)) {
@@ -192,7 +194,7 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
     } else if (check_target_limit(sptr, chptr, chptr->chname, 0)) {
       continue;
     } else {
-      int flags = CHFL_DEOPPED;
+      flags = CHFL_DEOPPED;
       int err = 0;
       int override = 0;
 
@@ -310,7 +312,7 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
               send_reply(sptr, RPL_TOPIC, chptrb->chname, chptrb->topic);
               send_reply(sptr, RPL_TOPICWHOTIME, chptrb->chname, chptrb->topic_nick, chptrb->topic_time);
             }
-            do_names(sptr, chptrb, NAMES_ALL|NAMES_EON); /* send /names list */
+            do_names(sptr, chptrb, NAMES_ALL|NAMES_EON|(((chptrb->mode.mode & MODE_AUDITORIUM) && !(flags & CHFL_CHANOP)) ? NAMES_OPS : 0)); /* send /names list */
                  }
            }
          }