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 3670 by michael, Thu May 29 11:29:14 2014 UTC vs.
Revision 3671 by michael, Thu May 29 11:47:48 2014 UTC

# Line 819 | Line 819 | chm_voice(struct Client *source_p, struc
819      return;
820    }
821  
822 <  if ((dir == MODE_QUERY) || parc <= *parn)
822 >  if (dir == MODE_QUERY || parc <= *parn)
823      return;
824  
825    opnick = parv[(*parn)++];
# Line 890 | Line 890 | chm_hop(struct Client *source_p, struct
890      return;
891    }
892  
893 <  if ((dir == MODE_QUERY) || (parc <= *parn))
893 >  if (dir == MODE_QUERY || parc <= *parn)
894      return;
895  
896    opnick = parv[(*parn)++];
# Line 950 | Line 950 | chm_op(struct Client *source_p, struct C
950      return;
951    }
952  
953 <  if ((dir == MODE_QUERY) || (parc <= *parn))
953 >  if (dir == MODE_QUERY || parc <= *parn)
954      return;
955  
956    opnick = parv[(*parn)++];
# Line 995 | Line 995 | static void
995   chm_limit(struct Client *source_p, struct Channel *chptr, int parc, int *parn,
996            char **parv, int *errors, int alev, int dir, char c, unsigned int d)
997   {
998  unsigned int i = 0;
998    int limit = 0;
999  
1000    if (alev < CHACCESS_HALFOP)
# Line 1011 | Line 1010 | chm_limit(struct Client *source_p, struc
1010    if (dir == MODE_QUERY)
1011      return;
1012  
1013 <  if ((dir == MODE_ADD) && parc > *parn)
1013 >  if (dir == MODE_ADD && parc > *parn)
1014    {
1015      char *lstr = parv[(*parn)++];
1016  
# Line 1021 | Line 1020 | chm_limit(struct Client *source_p, struc
1020      sprintf(lstr, "%d", limit);
1021  
1022      /* If somebody sets MODE #channel +ll 1 2, accept latter --fl */
1023 <    for (i = 0; i < mode_count; ++i)
1023 >    for (unsigned int i = 0; i < mode_count; ++i)
1024        if (mode_changes[i].letter == c && mode_changes[i].dir == MODE_ADD)
1025          mode_changes[i].letter = 0;
1026  
# Line 1052 | Line 1051 | static void
1051   chm_key(struct Client *source_p, struct Channel *chptr, int parc, int *parn,
1052          char **parv, int *errors, int alev, int dir, char c, unsigned int d)
1053   {
1055  unsigned int i = 0;
1056
1054    if (alev < CHACCESS_HALFOP)
1055    {
1056      if (!(*errors & SM_ERR_NOOPS))
# Line 1067 | Line 1064 | chm_key(struct Client *source_p, struct
1064    if (dir == MODE_QUERY)
1065      return;
1066  
1067 <  if ((dir == MODE_ADD) && parc > *parn)
1067 >  if (dir == MODE_ADD && parc > *parn)
1068    {
1069      char *key = parv[(*parn)++];
1070  
# Line 1083 | Line 1080 | chm_key(struct Client *source_p, struct
1080      strlcpy(chptr->mode.key, key, sizeof(chptr->mode.key));
1081  
1082      /* If somebody does MODE #channel +kk a b, accept latter --fl */
1083 <    for (i = 0; i < mode_count; ++i)
1083 >    for (unsigned int i = 0; i < mode_count; ++i)
1084        if (mode_changes[i].letter == c && mode_changes[i].dir == MODE_ADD)
1085          mode_changes[i].letter = 0;
1086  
# Line 1426 | Line 1423 | get_channel_access(const struct Client *
1423   static void
1424   send_mode_changes_server(struct Client *source_p, struct Channel *chptr)
1425   {
1429  unsigned int i;
1426    int mbl = 0, pbl = 0, arglen = 0, nc = 0, mc = 0;
1427    int len = 0;
1432  const char *arg = NULL;
1433  char *parptr;
1428    int dir = MODE_QUERY;
1429 +  const char *arg = NULL;
1430 +  char *parptr = NULL;
1431  
1432    parabuf[0] = '\0';
1433    parptr = parabuf;
# Line 1440 | Line 1436 | send_mode_changes_server(struct Client *
1436                   (unsigned long)chptr->channelts, chptr->chname);
1437  
1438    /* Loop the list of modes we have */
1439 <  for (i = 0; i < mode_count; ++i)
1439 >  for (unsigned i = 0; i < mode_count; ++i)
1440    {
1441      if (mode_changes[i].letter == 0)
1442        continue;
# Line 1518 | Line 1514 | send_mode_changes_server(struct Client *
1514   static void
1515   send_mode_changes(struct Client *source_p, struct Channel *chptr)
1516   {
1521  unsigned int i;
1517    int mbl = 0, pbl = 0, arglen = 0, nc = 0, mc = 0;
1518    int len = 0;
1524  const char *arg = NULL;
1525  char *parptr;
1519    int dir = MODE_QUERY;
1520 +  const char *arg = NULL;
1521 +  char *parptr = NULL;
1522  
1523    /* Bail out if we have nothing to do... */
1524    if (!mode_count)
# Line 1540 | Line 1535 | send_mode_changes(struct Client *source_
1535    parabuf[0] = '\0';
1536    parptr = parabuf;
1537  
1538 <  for (i = 0; i < mode_count; ++i)
1538 >  for (unsigned int i = 0; i < mode_count; ++i)
1539    {
1540      if (mode_changes[i].letter == 0 ||
1541          mode_changes[i].mems == NON_CHANOPS ||
# Line 1608 | Line 1603 | send_mode_changes(struct Client *source_
1603    send_mode_changes_server(source_p, chptr);
1604   }
1605  
1606 < /*
1606 > /*
1607   * Input: The the client this originated
1608   *        from, the channel, the parameter count starting at the modes,
1609   *        the parameters, the channel name.
# Line 1623 | Line 1618 | set_channel_mode(struct Client *source_p
1618   {
1619    int dir = MODE_ADD;
1620    int parn = 1;
1621 <  int alevel, errors = 0;
1621 >  int alevel = 0, errors = 0;
1622  
1623    mode_count = 0;
1624    mode_limit = 0;

Diff Legend

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