ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/modules/m_who.c
(Generate patch)

Comparing ircd-hybrid-8/modules/m_who.c (file contents):
Revision 1294 by michael, Wed Feb 22 20:48:30 2012 UTC vs.
Revision 1295 by michael, Sun Feb 26 15:22:44 2012 UTC

# Line 73 | Line 73 | m_who(struct Client *client_p, struct Cl
73    collapse(mask);
74  
75    /* '/who *' */
76 <  if (mask[0] == '*' && !mask[1])
76 >  if (!irccmp(mask, "*"))
77    {
78      if ((lp = source_p->channel.head) != NULL)
79      {
# Line 82 | Line 82 | m_who(struct Client *client_p, struct Cl
82                          server_oper);
83      }
84  
85 <    sendto_one(source_p, form_str(RPL_ENDOFWHO), me.name, source_p->name, "*");
85 >    sendto_one(source_p, form_str(RPL_ENDOFWHO),
86 >               me.name, source_p->name, "*");
87      return;
88    }
89  
# Line 126 | Line 127 | m_who(struct Client *client_p, struct Cl
127    }
128  
129    /* '/who 0' */
130 <  if (mask[0] == '0' && !mask[1])
130 >  if (!irccmp(mask, "0"))
131      who_global(source_p, NULL, server_oper);
132    else
133      who_global(source_p, mask, server_oper);
# Line 151 | Line 152 | static void
152   who_common_channel(struct Client *source_p, struct Channel *chptr,
153                     char *mask, int server_oper, int *maxmatches)
154   {
155 <  dlink_node *ptr;
155 <  struct Client *target_p;
155 >  dlink_node *ptr = NULL;
156  
157    DLINK_FOREACH(ptr, chptr->members.head)
158    {
159 <    target_p = ((struct Membership *)ptr->data)->client_p;
159 >    struct Client *target_p = ((struct Membership *)ptr->data)->client_p;
160  
161      if (!HasUMode(target_p, UMODE_INVISIBLE) || HasFlag(target_p, FLAGS_MARK))
162        continue;
163  
164 <    if (server_oper && !HasUMode(target_p, UMODE_OPER))
165 <      continue;
164 >    if (server_oper)
165 >      if (!HasUMode(target_p, UMODE_OPER) ||
166 >          (HasUMode(target_p, UMODE_HIDDEN) && !HasUMode(source_p, UMODE_OPER)))
167 >        continue;
168  
169      AddFlag(target_p, FLAGS_MARK);
170  
# Line 240 | Line 242 | who_global(struct Client *source_p, char
242        continue;
243      }
244  
245 <    if (server_oper && !HasUMode(target_p, UMODE_OPER))
246 <      continue;
245 >    if (server_oper)
246 >      if (!HasUMode(target_p, UMODE_OPER) ||
247 >          (HasUMode(target_p, UMODE_HIDDEN) && !HasUMode(source_p, UMODE_OPER)))
248 >        continue;
249  
250      assert(target_p->servptr != NULL);
251  
# Line 287 | Line 291 | do_who_on_channel(struct Client *source_
291  
292      if (member || !HasUMode(target_p, UMODE_INVISIBLE))
293      {
294 <      if (server_oper && !HasUMode(target_p, UMODE_OPER))
295 <        continue;
294 >      if (server_oper)
295 >        if (!HasUMode(target_p, UMODE_OPER) ||
296 >            (HasUMode(target_p, UMODE_HIDDEN) && !HasUMode(source_p, UMODE_OPER)))
297 >          continue;
298        do_who(source_p, target_p, chname, get_member_status(ms, !!HasCap(source_p, CAP_MULTI_PREFIX)));
299      }
300    }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)