ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/channel_mode.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/channel_mode.c (file contents):
Revision 8043 by michael, Sat Mar 18 16:32:07 2017 UTC vs.
Revision 8044 by michael, Sat Mar 18 16:52:10 2017 UTC

# Line 283 | Line 283 | channel_modes(struct Channel *chptr, str
283    *pbuf = '\0';
284  
285    for (const struct mode_letter *tab = chan_modes; tab->mode; ++tab)
286 <    if (chptr->mode.mode & tab->mode)
286 >    if (HasCMode(chptr, tab->mode))
287        *mbuf++ = tab->letter;
288  
289    if (chptr->mode.limit)
# Line 406 | Line 406 | chm_simple(struct Client *source_p, stru
406     */
407    if (dir == MODE_ADD) /* && !(chptr->mode.mode & d)) */
408    {
409 <    chptr->mode.mode |= d;
409 >    AddCMode(chptr, d);
410  
411      mode_changes[mode_count].letter = c;
412      mode_changes[mode_count].arg = NULL;
# Line 417 | Line 417 | chm_simple(struct Client *source_p, stru
417    else if (dir == MODE_DEL) /* && (chptr->mode.mode & d)) */
418    {
419      /* setting - */
420 <
421 <    chptr->mode.mode &= ~d;
420 >    DelCMode(chptr, d);
421  
422      mode_changes[mode_count].letter = c;
423      mode_changes[mode_count].arg = NULL;
# Line 459 | Line 458 | chm_registered(struct Client *source_p,
458     */
459    if (dir == MODE_ADD) /* && !(chptr->mode.mode & d)) */
460    {
461 <    chptr->mode.mode |= d;
461 >    AddCMode(chptr, d);
462  
463      mode_changes[mode_count].letter = c;
464      mode_changes[mode_count].arg = NULL;
# Line 470 | Line 469 | chm_registered(struct Client *source_p,
469    else if (dir == MODE_DEL) /* && (chptr->mode.mode & d)) */
470    {
471      /* setting - */
472 <
474 <    chptr->mode.mode &= ~d;
472 >    DelCMode(chptr, d);
473  
474      mode_changes[mode_count].letter = c;
475      mode_changes[mode_count].arg = NULL;
# Line 513 | Line 511 | chm_operonly(struct Client *source_p, st
511  
512    if (dir == MODE_ADD) /* && !(chptr->mode.mode & d)) */
513    {
514 <    chptr->mode.mode |= d;
514 >    AddCMode(chptr, d);
515  
516      mode_changes[mode_count].letter = c;
517      mode_changes[mode_count].arg = NULL;
# Line 524 | Line 522 | chm_operonly(struct Client *source_p, st
522    else if (dir == MODE_DEL) /* && (chptr->mode.mode & d)) */
523    {
524      /* setting - */
525 <
528 <    chptr->mode.mode &= ~d;
525 >    DelCMode(chptr, d);
526  
527      mode_changes[mode_count].letter = c;
528      mode_changes[mode_count].arg = NULL;
# Line 552 | Line 549 | chm_ban(struct Client *source_p, struct
549      {
550        const struct Ban *ban = node->data;
551  
552 <      if (!(chptr->mode.mode & MODE_HIDEBMASKS) || alev >= CHACCESS_HALFOP)
552 >      if (!HasCMode(chptr, MODE_HIDEBMASKS) || alev >= CHACCESS_HALFOP)
553          sendto_one_numeric(source_p, &me, RPL_BANLIST, chptr->name,
554                             ban->name, ban->user, ban->host,
555                             ban->who, ban->when);
# Line 600 | Line 597 | chm_ban(struct Client *source_p, struct
597    mode_changes[mode_count].letter = c;
598    mode_changes[mode_count].arg = mask;  /* At this point 'mask' is no longer than NICKLEN + USERLEN + HOSTLEN + 3 */
599    mode_changes[mode_count].id = NULL;
600 <  if (chptr->mode.mode & MODE_HIDEBMASKS)
600 >  if (HasCMode(chptr, MODE_HIDEBMASKS))
601      mode_changes[mode_count].flags = CHFL_CHANOP | CHFL_HALFOP;
602    else
603      mode_changes[mode_count].flags = 0;
# Line 624 | Line 621 | chm_except(struct Client *source_p, stru
621      {
622        const struct Ban *ban = node->data;
623  
624 <      if (!(chptr->mode.mode & MODE_HIDEBMASKS) || alev >= CHACCESS_HALFOP)
624 >      if (!HasCMode(chptr, MODE_HIDEBMASKS) || alev >= CHACCESS_HALFOP)
625          sendto_one_numeric(source_p, &me, RPL_EXCEPTLIST, chptr->name,
626                             ban->name, ban->user, ban->host,
627                             ban->who, ban->when);
# Line 672 | Line 669 | chm_except(struct Client *source_p, stru
669    mode_changes[mode_count].letter = c;
670    mode_changes[mode_count].arg = mask;  /* At this point 'mask' is no longer than NICKLEN + USERLEN + HOSTLEN + 3 */
671    mode_changes[mode_count].id = NULL;
672 <  if (chptr->mode.mode & MODE_HIDEBMASKS)
672 >  if (HasCMode(chptr, MODE_HIDEBMASKS))
673      mode_changes[mode_count].flags = CHFL_CHANOP | CHFL_HALFOP;
674    else
675      mode_changes[mode_count].flags = 0;
# Line 696 | Line 693 | chm_invex(struct Client *source_p, struc
693      {
694        const struct Ban *ban = node->data;
695  
696 <      if (!(chptr->mode.mode & MODE_HIDEBMASKS) || alev >= CHACCESS_HALFOP)
696 >      if (!HasCMode(chptr, MODE_HIDEBMASKS) || alev >= CHACCESS_HALFOP)
697          sendto_one_numeric(source_p, &me, RPL_INVEXLIST, chptr->name,
698                             ban->name, ban->user, ban->host,
699                             ban->who, ban->when);
# Line 744 | Line 741 | chm_invex(struct Client *source_p, struc
741    mode_changes[mode_count].letter = c;
742    mode_changes[mode_count].arg = mask;  /* At this point 'mask' is no longer than NICKLEN + USERLEN + HOSTLEN + 3 */
743    mode_changes[mode_count].id = NULL;
744 <  if (chptr->mode.mode & MODE_HIDEBMASKS)
744 >  if (HasCMode(chptr, MODE_HIDEBMASKS))
745      mode_changes[mode_count].flags = CHFL_CHANOP | CHFL_HALFOP;
746    else
747      mode_changes[mode_count].flags = 0;

Diff Legend

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