m_join forward nicklist restriction & m_names manual nicklist restriction
authorpk910 <philipp@zoelle1.de>
Tue, 28 Jun 2011 20:23:50 +0000 (22:23 +0200)
committerpk910 <philipp@zoelle1.de>
Tue, 28 Jun 2011 20:23:50 +0000 (22:23 +0200)
ircd/m_join.c
ircd/m_names.c

index 89ef8c7f918e33f88a4e8535d2ec551a7e982561..88681c75edcda1e428be9267f6aa212a015f104f 100644 (file)
@@ -312,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 */
                  }
            }
          }
index 41a48c7f207cc00c69fc51304e65ae2fff98a3eb..13950fc22a32ce22468729a2997b4d28b474828e 100644 (file)
@@ -246,15 +246,16 @@ int m_names(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       mlen = strlen(cli_name(&me)) + 10 + strlen(cli_name(sptr));
 
       /* List all visible channels/visible members */ 
-
+      struct Membership *member;
       for (ch2ptr = GlobalChannelList; ch2ptr; ch2ptr = ch2ptr->next)
       { 
         if (!ShowChannel(sptr, ch2ptr))
           continue;                 /* Don't show secret chans. */ 
-        else if (find_channel_member(sptr, ch2ptr))
-          do_names(sptr, ch2ptr, showingdelayed|NAMES_ALL); /* Full list if we're in this chan. */
-        else
-          do_names(sptr, ch2ptr, showingdelayed|NAMES_VIS);
+        else if ((member = find_channel_member(sptr, ch2ptr))) {
+                 
+          do_names(sptr, ch2ptr, showingdelayed|NAMES_ALL|((chptr->mode.mode & MODE_AUDITORIUM) && !(member->status & MODE_CHANOP) ? NAMES_OPS : 0)); /* Full list if we're in this chan. */
+        } else
+          do_names(sptr, ch2ptr, showingdelayed|NAMES_VIS|((chptr->mode.mode & MODE_AUDITORIUM) ? NAMES_OPS : 0));
       } 
 
       /* List all remaining users on channel '*' */