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

Comparing ircd-hybrid/trunk/src/channel.c (file contents):
Revision 8660 by michael, Sun Nov 18 12:55:59 2018 UTC vs.
Revision 8664 by michael, Thu Nov 22 14:26:32 2018 UTC

# Line 65 | Line 65 | channel_get_list(void)
65   */
66   void
67   add_user_to_channel(struct Channel *chptr, struct Client *client_p,
68 <                    unsigned int flags, int flood_ctrl)
68 >                    unsigned int flags, bool flood_ctrl)
69   {
70    assert(IsClient(client_p));
71  
72    if (GlobalSetOptions.joinfloodtime)
73    {
74 <    if (flood_ctrl)
74 >    if (flood_ctrl == true)
75        ++chptr->number_joined;
76  
77      chptr->number_joined -= (CurrentTime - chptr->last_join_time) *
# Line 611 | Line 611 | get_member_status(const struct Membershi
611   * \param list     Pointer to ban list to search
612   * \return 1 if ban found for given n!u\@h mask, 0 otherwise
613   */
614 < static int
614 > static bool
615   find_bmask(const struct Client *client_p, const dlink_list *list)
616   {
617    dlink_node *node;
# Line 626 | Line 626 | find_bmask(const struct Client *client_p
626        {
627          case HM_HOST:
628            if (!match(ban->host, client_p->host) || !match(ban->host, client_p->sockhost))
629 <            return 1;
629 >            return true;
630            break;
631          case HM_IPV4:
632            if (client_p->ip.ss.ss_family == AF_INET)
633              if (match_ipv4(&client_p->ip, &ban->addr, ban->bits))
634 <              return 1;
634 >              return true;
635            break;
636          case HM_IPV6:
637            if (client_p->ip.ss.ss_family == AF_INET6)
638              if (match_ipv6(&client_p->ip, &ban->addr, ban->bits))
639 <              return 1;
639 >              return true;
640            break;
641          default:
642            assert(0);
# Line 644 | Line 644 | find_bmask(const struct Client *client_p
644      }
645    }
646  
647 <  return 0;
647 >  return false;
648   }
649  
650   /*!
# Line 652 | Line 652 | find_bmask(const struct Client *client_p
652   * \param client_p Pointer to client to check access fo
653   * \return 0 if not banned, 1 otherwise
654   */
655 < int
655 > bool
656   is_banned(const struct Channel *chptr, const struct Client *client_p)
657   {
658 <  if (find_bmask(client_p, &chptr->banlist))
659 <    if (!find_bmask(client_p, &chptr->exceptlist))
660 <      return 1;
658 >  if (find_bmask(client_p, &chptr->banlist) == true)
659 >    if (find_bmask(client_p, &chptr->exceptlist) == false)
660 >      return true;
661  
662 <  return 0;
662 >  return false;
663   }
664  
665   /*! Tests if a client can join a certain channel
# Line 683 | Line 683 | can_join(struct Client *client_p, struct
683  
684    if (HasCMode(chptr, MODE_INVITEONLY))
685      if (!find_invite(chptr, client_p))
686 <      if (!find_bmask(client_p, &chptr->invexlist))
686 >      if (find_bmask(client_p, &chptr->invexlist) == false)
687          return ERR_INVITEONLYCHAN;
688  
689    if (chptr->mode.key[0] && (!key || strcmp(chptr->mode.key, key)))
# Line 693 | Line 693 | can_join(struct Client *client_p, struct
693        chptr->mode.limit)
694      return ERR_CHANNELISFULL;
695  
696 <  if (is_banned(chptr, client_p))
696 >  if (is_banned(chptr, client_p) == true)
697      return ERR_BANNEDFROMCHAN;
698  
699    return 0;
# Line 817 | Line 817 | can_send(struct Channel *chptr, struct C
817  
818        if (!(member->flags & CHFL_BAN_CHECKED))
819        {
820 <        if (is_banned(chptr, client_p))
820 >        if (is_banned(chptr, client_p) == true)
821          {
822            member->flags |= (CHFL_BAN_CHECKED | CHFL_BAN_SILENCED);
823            return ERR_CANNOTSENDTOCHAN;
# Line 826 | Line 826 | can_send(struct Channel *chptr, struct C
826          member->flags |= CHFL_BAN_CHECKED;
827        }
828      }
829 <    else if (is_banned(chptr, client_p))
829 >    else if (is_banned(chptr, client_p) == true)
830        return ERR_CANNOTSENDTOCHAN;
831    }
832  
# Line 990 | Line 990 | channel_do_join(struct Client *client_p,
990      if (!HasUMode(client_p, UMODE_OPER))
991        check_spambot_warning(client_p, chptr->name);
992  
993 <    add_user_to_channel(chptr, client_p, flags, 1);
993 >    add_user_to_channel(chptr, client_p, flags, true);
994  
995      /*
996       * Set timestamp if appropriate, and propagate

Diff Legend

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