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

Comparing:
ircd-hybrid/src/channel_mode.c (file contents), Revision 32 by knight, Sun Oct 2 20:41:23 2005 UTC vs.
ircd-hybrid-8/src/channel_mode.c (file contents), Revision 1167 by michael, Thu Aug 11 20:13:38 2011 UTC

# Line 23 | Line 23
23   */
24  
25   #include "stdinc.h"
26 < #include "tools.h"
26 > #include "list.h"
27   #include "channel.h"
28   #include "channel_mode.h"
29   #include "client.h"
30   #include "common.h"
31   #include "hash.h"
32 + #include "hostmask.h"
33   #include "irc_string.h"
34   #include "sprintf_irc.h"
35   #include "ircd.h"
35 – #include "list.h"
36   #include "numeric.h"
37   #include "s_serv.h"             /* captab */
38   #include "s_user.h"
# Line 43 | Line 43
43   #include "memory.h"
44   #include "balloc.h"
45   #include "s_log.h"
46 + #include "msg.h"
47  
48   /* some small utility functions */
49   static char *check_string(char *);
# Line 54 | Line 55 | static void chm_nosuch(struct Client *,
55   static void chm_simple(struct Client *, struct Client *, struct Channel *,
56                         int, int *, char **, int *, int, int, char, void *,
57                         const char *);
58 + static void chm_registered(struct Client *, struct Client *, struct Channel *,
59 +                       int, int *, char **, int *, int, int, char, void *,
60 +                       const char *);
61   static void chm_limit(struct Client *, struct Client *, struct Channel *,
62                        int, int *, char **, int *, int, int, char, void *,
63                        const char *);
# Line 81 | Line 85 | static void chm_invex(struct Client *, s
85                        int, int *, char **, int *, int, int, char, void *,
86                        const char *);
87   static void send_cap_mode_changes(struct Client *, struct Client *,
88 <                                  struct Channel *, int, int);
88 >                                  struct Channel *, unsigned int, unsigned int);
89   static void send_mode_changes(struct Client *, struct Client *,
90                                struct Channel *, char *);
91  
# Line 90 | Line 94 | static void send_mode_changes(struct Cli
94   #define NCHCAPS         (sizeof(channel_capabs)/sizeof(int))
95   #define NCHCAP_COMBOS   (1 << NCHCAPS)
96  
97 + static char nuh_mask[MAXPARA][IRCD_BUFSIZE];
98   /* some buffers for rebuilding channel/nick lists with ,'s */
99   static char modebuf[IRCD_BUFSIZE];
100   static char parabuf[MODEBUFLEN];
# Line 97 | Line 102 | static struct ChModeChange mode_changes[
102   static int mode_count;
103   static int mode_limit;          /* number of modes set other than simple */
104   static int simple_modes_mask;   /* bit mask of simple modes already set */
105 + #ifdef HALFOPS
106 + static int channel_capabs[] = { CAP_EX, CAP_IE, CAP_TS6, CAP_HOPS };
107 + #else
108   static int channel_capabs[] = { CAP_EX, CAP_IE, CAP_TS6 };
109 + #endif
110   static struct ChCapCombo chcap_combos[NCHCAP_COMBOS];
111   extern BlockHeap *ban_heap;
112  
# Line 119 | Line 128 | check_string(char *s)
128    static char star[] = "*";
129  
130    if (EmptyString(s))
131 <    return (star);
131 >    return star;
132  
133    for (; *s; ++s)
134    {
# Line 130 | Line 139 | check_string(char *s)
139      }
140    }
141  
142 <  return (str);
142 >  return str;
143   }
144  
145   /*
# Line 143 | Line 152 | check_string(char *s)
152   int
153   add_id(struct Client *client_p, struct Channel *chptr, char *banid, int type)
154   {
155 <  dlink_list *list;
156 <  dlink_node *ban;
155 >  dlink_list *list = NULL;
156 >  dlink_node *ban = NULL;
157    size_t len = 0;
158 <  struct Ban *actualBan;
158 >  struct Ban *ban_p = NULL;
159    unsigned int num_mask;
160 <  char *name = NULL, *user = NULL, *host = NULL;
160 >  char name[NICKLEN];
161 >  char user[USERLEN + 1];
162 >  char host[HOSTLEN + 1];
163 >  struct split_nuh_item nuh;
164  
165    /* dont let local clients overflow the b/e/I lists */
166    if (MyClient(client_p))
# Line 167 | Line 179 | add_id(struct Client *client_p, struct C
179      collapse(banid);
180    }
181  
182 <  split_nuh(check_string(banid), &name, &user, &host);
182 >  nuh.nuhmask  = check_string(banid);
183 >  nuh.nickptr  = name;
184 >  nuh.userptr  = user;
185 >  nuh.hostptr  = host;
186 >
187 >  nuh.nicksize = sizeof(name);
188 >  nuh.usersize = sizeof(user);
189 >  nuh.hostsize = sizeof(host);
190 >
191 >  split_nuh(&nuh);
192  
193    /*
194 <   * Assemble a n!u@h and print it back to banid for sending
194 >   * Re-assemble a new n!u@h and print it back to banid for sending
195     * the mode to the channel.
196     */
197    len = ircsprintf(banid, "%s!%s@%s", name, user, host);
# Line 195 | Line 216 | add_id(struct Client *client_p, struct C
216  
217    DLINK_FOREACH(ban, list->head)
218    {
219 <    actualBan = ban->data;
220 <    if (!irccmp(actualBan->name, name) &&
221 <        !irccmp(actualBan->username, user) &&
222 <        !irccmp(actualBan->host, host))
219 >    ban_p = ban->data;
220 >    if (!irccmp(ban_p->name, name) &&
221 >        !irccmp(ban_p->username, user) &&
222 >        !irccmp(ban_p->host, host))
223      {
203 –      MyFree(name);
204 –      MyFree(user);
205 –      MyFree(host);
224        return 0;
225      }
226    }
227  
228 <  actualBan = BlockHeapAlloc(ban_heap);
229 <  actualBan->when = CurrentTime;
230 <  actualBan->name = name;
231 <  actualBan->username = user;
232 <  actualBan->host = host;
233 <  actualBan->len = len-2; /* -2 for @ and ! */
228 >  ban_p = BlockHeapAlloc(ban_heap);
229 >
230 >  DupString(ban_p->name, name);
231 >  DupString(ban_p->username, user);
232 >  DupString(ban_p->host, host);
233 >
234 >  ban_p->when = CurrentTime;
235 >  ban_p->len = len - 2; /* -2 for @ and ! */
236 >  ban_p->type = parse_netmask(host, &ban_p->addr, &ban_p->bits);
237  
238    if (IsClient(client_p))
239    {
240 <    actualBan->who =
241 <      MyMalloc(strlen(client_p->name) +
242 <               strlen(client_p->username) +
243 <               strlen(client_p->host) + 3);
244 <    ircsprintf(actualBan->who, "%s!%s@%s",
224 <               client_p->name, client_p->username, client_p->host);
240 >    ban_p->who = MyMalloc(strlen(client_p->name) +
241 >                          strlen(client_p->username) +
242 >                          strlen(client_p->host) + 3);
243 >    ircsprintf(ban_p->who, "%s!%s@%s", client_p->name,
244 >               client_p->username, client_p->host);
245    }
246    else
247 <    DupString(actualBan->who, client_p->name);
247 >    DupString(ban_p->who, client_p->name);
248  
249 <  dlinkAdd(actualBan, &actualBan->node, list);
249 >  dlinkAdd(ban_p, &ban_p->node, list);
250  
251    return 1;
252   }
# Line 244 | Line 264 | del_id(struct Channel *chptr, char *bani
264    dlink_list *list;
265    dlink_node *ban;
266    struct Ban *banptr;
267 <  char *name = NULL, *user = NULL, *host = NULL;
267 >  char name[NICKLEN];
268 >  char user[USERLEN + 1];
269 >  char host[HOSTLEN + 1];
270 >  struct split_nuh_item nuh;
271  
272    if (banid == NULL)
273      return 0;
274  
275 <  split_nuh(check_string(banid), &name, &user, &host);
275 >  nuh.nuhmask  = check_string(banid);
276 >  nuh.nickptr  = name;
277 >  nuh.userptr  = user;
278 >  nuh.hostptr  = host;
279 >
280 >  nuh.nicksize = sizeof(name);
281 >  nuh.usersize = sizeof(user);
282 >  nuh.hostsize = sizeof(host);
283 >
284 >  split_nuh(&nuh);
285  
286    /*
287 <   * Assemble a n!u@h and print it back to banid for sending
287 >   * Re-assemble a new n!u@h and print it back to banid for sending
288     * the mode to the channel.
289     */
290    ircsprintf(banid, "%s!%s@%s", name, user, host);
# Line 273 | Line 305 | del_id(struct Channel *chptr, char *bani
305      default:
306        sendto_realops_flags(UMODE_ALL, L_ALL,
307                             "del_id() called with unknown ban type %d!", type);
308 <      MyFree(name);
277 <      MyFree(user);
278 <      MyFree(host);
279 <      return(0);
308 >      return 0;
309    }
310  
311    DLINK_FOREACH(ban, list->head)
# Line 284 | Line 313 | del_id(struct Channel *chptr, char *bani
313      banptr = ban->data;
314  
315      if (!irccmp(name, banptr->name) &&
316 <        !irccmp(user, banptr->username) &&
317 <        !irccmp(host, banptr->host))
316 >        !irccmp(user, banptr->username) &&
317 >        !irccmp(host, banptr->host))
318      {
319        remove_ban(banptr, list);
291 –      MyFree(name);
292 –      MyFree(user);
293 –      MyFree(host);
320        return 1;
321      }
322    }
323  
298 –  MyFree(name);
299 –  MyFree(user);
300 –  MyFree(host);
324    return 0;
325   }
326  
# Line 310 | Line 333 | static const struct mode_letter
333    { MODE_MODERATED,  'm' },
334    { MODE_NOPRIVMSGS, 'n' },
335    { MODE_PRIVATE,    'p' },
336 +  { MODE_REGISTERED, 'r' },
337    { MODE_SECRET,     's' },
338    { MODE_TOPICLIMIT, 't' },
339 +  { MODE_OPERONLY,   'O' },
340 +  { MODE_SSLONLY,    'S' },
341    { 0, '\0' }
342   };
343  
# Line 342 | Line 368 | channel_modes(struct Channel *chptr, str
368    {
369      *mbuf++ = 'l';
370  
371 <    if (IsMember(client_p, chptr) || IsServer(client_p))
371 >    if (IsServer(client_p) || IsService(client_p) || IsMember(client_p, chptr))
372        pbuf += ircsprintf(pbuf, "%d ", chptr->mode.limit);
373    }
374  
# Line 350 | Line 376 | channel_modes(struct Channel *chptr, str
376    {
377      *mbuf++ = 'k';
378  
379 <    if (*pbuf || IsMember(client_p, chptr) || IsServer(client_p))
379 >    if (IsServer(client_p) || IsService(client_p) || IsMember(client_p, chptr))
380        ircsprintf(pbuf, "%s ", chptr->mode.key);
381    }
382  
# Line 417 | Line 443 | fix_key_old(char *arg)
443   #define SM_ERR_RPL_E        0x00000010
444   #define SM_ERR_NOTONCHANNEL 0x00000020 /* Not on channel    */
445   #define SM_ERR_RPL_I        0x00000040
446 + #define SM_ERR_NOTOPER      0x00000080
447 + #define SM_ERR_ONLYSERVER   0x00000100
448  
449   /* Now lets do some stuff to keep track of what combinations of
450   * servers exist...
# Line 592 | Line 620 | chm_simple(struct Client *client_p, stru
620   }
621  
622   static void
623 + chm_registered(struct Client *client_p, struct Client *source_p, struct Channel *chptr,
624 +           int parc, int *parn, char **parv, int *errors, int alev, int dir,
625 +           char c, void *d, const char *chname)
626 + {
627 +  long mode_type;
628 +
629 +  mode_type = (long)d;
630 +
631 +
632 +  if (!IsServer(source_p) && !IsService(source_p))
633 +  {
634 +    if (!(*errors & SM_ERR_ONLYSERVER))
635 +      sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ?
636 +                                    ERR_NOTONCHANNEL : ERR_ONLYSERVERSCANCHANGE),
637 +                 me.name, source_p->name, chname);
638 +    *errors |= SM_ERR_ONLYSERVER;
639 +    return;
640 +  }
641 +
642 +  /* If have already dealt with this simple mode, ignore it */
643 +  if (simple_modes_mask & mode_type)
644 +    return;
645 +
646 +  simple_modes_mask |= mode_type;
647 +
648 +  /* setting + */
649 +  /* Apparently, (though no one has ever told the hybrid group directly)
650 +   * admins don't like redundant mode checking. ok. It would have been nice
651 +   * if you had have told us directly. I've left the original code snippets
652 +   * in place.
653 +   *
654 +   * -Dianora
655 +   */
656 +  if ((dir == MODE_ADD)) /* && !(chptr->mode.mode & mode_type)) */
657 +  {
658 +    chptr->mode.mode |= mode_type;
659 +
660 +    mode_changes[mode_count].letter = c;
661 +    mode_changes[mode_count].dir = MODE_ADD;
662 +    mode_changes[mode_count].caps = 0;
663 +    mode_changes[mode_count].nocaps = 0;
664 +    mode_changes[mode_count].id = NULL;
665 +    mode_changes[mode_count].mems = ALL_MEMBERS;
666 +    mode_changes[mode_count++].arg = NULL;
667 +  }
668 +  else if ((dir == MODE_DEL)) /* && (chptr->mode.mode & mode_type)) */
669 +  {
670 +    /* setting - */
671 +
672 +    chptr->mode.mode &= ~mode_type;
673 +
674 +    mode_changes[mode_count].letter = c;
675 +    mode_changes[mode_count].dir = MODE_DEL;
676 +    mode_changes[mode_count].caps = 0;
677 +    mode_changes[mode_count].nocaps = 0;
678 +    mode_changes[mode_count].mems = ALL_MEMBERS;
679 +    mode_changes[mode_count].id = NULL;
680 +    mode_changes[mode_count++].arg = NULL;
681 +  }
682 + }
683 +
684 + static void
685 + chm_operonly(struct Client *client_p, struct Client *source_p, struct Channel *chptr,
686 +            int parc, int *parn, char **parv, int *errors, int alev, int dir,
687 +            char c, void *d, const char *chname)
688 + {
689 +  long mode_type;
690 +
691 +  mode_type = (long)d;
692 +
693 +  if ((alev < CHACCESS_HALFOP) ||
694 +      ((mode_type == MODE_PRIVATE) && (alev < CHACCESS_CHANOP)))
695 +  {
696 +    if (!(*errors & SM_ERR_NOOPS))
697 +      sendto_one(source_p, form_str(alev == CHACCESS_NOTONCHAN ?
698 +                                    ERR_NOTONCHANNEL : ERR_CHANOPRIVSNEEDED),
699 +                 me.name, source_p->name, chname);
700 +    *errors |= SM_ERR_NOOPS;
701 +    return;
702 +  }
703 +  else if (MyClient(source_p) && !IsOper(source_p))
704 +  {
705 +    if (!(*errors & SM_ERR_NOTOPER))
706 +    {
707 +      if (alev == CHACCESS_NOTONCHAN)
708 +        sendto_one(source_p, form_str(ERR_NOTONCHANNEL),
709 +                   me.name, source_p->name, chname);
710 +      else
711 +        sendto_one(source_p, form_str(ERR_NOPRIVILEGES),
712 +                   me.name, source_p->name);
713 +    }
714 +
715 +    *errors |= SM_ERR_NOTOPER;
716 +    return;
717 +  }
718 +
719 +  /* If have already dealt with this simple mode, ignore it */
720 +  if (simple_modes_mask & mode_type)
721 +    return;
722 +
723 +  simple_modes_mask |= mode_type;
724 +
725 +  if ((dir == MODE_ADD)) /* && !(chptr->mode.mode & mode_type)) */
726 +  {
727 +    chptr->mode.mode |= mode_type;
728 +
729 +    mode_changes[mode_count].letter = c;
730 +    mode_changes[mode_count].dir = MODE_ADD;
731 +    mode_changes[mode_count].caps = 0;
732 +    mode_changes[mode_count].nocaps = 0;
733 +    mode_changes[mode_count].id = NULL;
734 +    mode_changes[mode_count].mems = ALL_MEMBERS;
735 +    mode_changes[mode_count].mems = ALL_MEMBERS;
736 +    mode_changes[mode_count++].arg = NULL;
737 +  }
738 +  else if ((dir == MODE_DEL)) /* && (chptr->mode.mode & mode_type)) */
739 +  {
740 +    /* setting - */
741 +
742 +    chptr->mode.mode &= ~mode_type;
743 +
744 +    mode_changes[mode_count].letter = c;
745 +    mode_changes[mode_count].dir = MODE_DEL;
746 +    mode_changes[mode_count].caps = 0;
747 +    mode_changes[mode_count].nocaps = 0;
748 +    mode_changes[mode_count].mems = ALL_MEMBERS;
749 +    mode_changes[mode_count].id = NULL;
750 +    mode_changes[mode_count++].arg = NULL;
751 +  }
752 + }
753 +
754 + static void
755   chm_ban(struct Client *client_p, struct Client *source_p,
756          struct Channel *chptr, int parc, int *parn,
757          char **parv, int *errors, int alev, int dir, char c, void *d,
# Line 635 | Line 795 | chm_ban(struct Client *client_p, struct
795    if (MyClient(source_p) && (++mode_limit > MAXMODEPARAMS))
796      return;
797  
798 <  mask = parv[(*parn)++];
799 <  
798 >  mask = nuh_mask[*parn];
799 >  memcpy(mask, parv[*parn], sizeof(nuh_mask[*parn]));
800 >  ++*parn;
801 >
802    if (IsServer(client_p))
803      if (strchr(mask, ' '))
804        return;
# Line 648 | Line 810 | chm_ban(struct Client *client_p, struct
810          return;
811        break;
812      case MODE_DEL:
651 – /* XXX grrrrrrr */
652 – #ifdef NO_BAN_COOKIE
813        if (!del_id(chptr, mask, CHFL_BAN))
814          return;
655 – #else
656 –     /* XXX this hack allows /mode * +o-b nick ban.cookie
657 –      * I'd like to see this hack go away in the future.
658 –      */
659 –      del_id(chptr, mask, CHFL_BAN);
660 – #endif
815        break;
816      default:
817        assert(0);
# Line 730 | Line 884 | chm_except(struct Client *client_p, stru
884    if (MyClient(source_p) && (++mode_limit > MAXMODEPARAMS))
885      return;
886  
887 <  mask = parv[(*parn)++];
887 >  mask = nuh_mask[*parn];
888 >  memcpy(mask, parv[*parn], sizeof(nuh_mask[*parn]));
889 >  ++*parn;
890  
891    if (IsServer(client_p))
892      if (strchr(mask, ' '))
# Line 822 | Line 978 | chm_invex(struct Client *client_p, struc
978    if (MyClient(source_p) && (++mode_limit > MAXMODEPARAMS))
979      return;
980  
981 <  mask = parv[(*parn)++];
981 >  mask = nuh_mask[*parn];
982 >  memcpy(mask, parv[*parn], sizeof(nuh_mask[*parn]));
983 >  ++*parn;
984  
985    if (IsServer(client_p))
986      if (strchr(mask, ' '))
# Line 866 | Line 1024 | clear_ban_cache(struct Channel *chptr)
1024   {
1025    dlink_node *ptr = NULL;
1026  
1027 <  DLINK_FOREACH(ptr, chptr->locmembers.head)
1027 >  DLINK_FOREACH(ptr, chptr->members.head)
1028 >  {
1029 >    struct Membership *ms = ptr->data;
1030 >
1031 >    if (MyConnect(ms->client_p))
1032 >      ms->flags &= ~(CHFL_BAN_SILENCED|CHFL_BAN_CHECKED);
1033 >  }
1034 > }
1035 >
1036 > void
1037 > clear_ban_cache_client(struct Client *client_p)
1038 > {
1039 >  dlink_node *ptr = NULL;
1040 >
1041 >  DLINK_FOREACH(ptr, client_p->channel.head)
1042    {
1043      struct Membership *ms = ptr->data;
1044      ms->flags &= ~(CHFL_BAN_SILENCED|CHFL_BAN_CHECKED);
# Line 882 | Line 1054 | chm_op(struct Client *client_p, struct C
1054    char *opnick;
1055    struct Client *targ_p;
1056    struct Membership *member;
1057 +  int caps = 0;
1058  
1059    if (alev < CHACCESS_CHANOP)
1060    {
# Line 919 | Line 1092 | chm_op(struct Client *client_p, struct C
1092    if (dir == MODE_ADD &&  has_member_flags(member, CHFL_CHANOP))
1093      return;
1094    if (dir == MODE_DEL && !has_member_flags(member, CHFL_CHANOP))
1095 +  {
1096 + #ifdef HALFOPS
1097 +    if (has_member_flags(member, CHFL_HALFOP))
1098 +    {
1099 +      --*parn;
1100 +      chm_hop(client_p, source_p, chptr, parc, parn, parv, errors, alev,
1101 +              dir, c, d, chname);
1102 +    }
1103 + #endif
1104      return;
1105 +  }
1106 +
1107 + #ifdef HALFOPS
1108 +  if (dir == MODE_ADD && has_member_flags(member, CHFL_HALFOP))
1109 +  {
1110 +    /* promoting from % to @ is visible only to CAP_HOPS servers */
1111 +    mode_changes[mode_count].letter = 'h';
1112 +    mode_changes[mode_count].dir = MODE_DEL;
1113 +    mode_changes[mode_count].caps = caps = CAP_HOPS;
1114 +    mode_changes[mode_count].nocaps = 0;
1115 +    mode_changes[mode_count].mems = ALL_MEMBERS;
1116 +    mode_changes[mode_count].id = NULL;
1117 +    mode_changes[mode_count].arg = targ_p->name;
1118 +    mode_changes[mode_count++].client = targ_p;
1119 +  }
1120 + #endif
1121  
1122    mode_changes[mode_count].letter = 'o';
1123    mode_changes[mode_count].dir = dir;
1124 <  mode_changes[mode_count].caps = 0;
1124 >  mode_changes[mode_count].caps = caps;
1125    mode_changes[mode_count].nocaps = 0;
1126    mode_changes[mode_count].mems = ALL_MEMBERS;
1127    mode_changes[mode_count].id = targ_p->id;
# Line 933 | Line 1131 | chm_op(struct Client *client_p, struct C
1131    if (dir == MODE_ADD)
1132    {
1133      AddMemberFlag(member, CHFL_CHANOP);
1134 <    DelMemberFlag(member, CHFL_DEOPPED);
1134 >    DelMemberFlag(member, CHFL_DEOPPED | CHFL_HALFOP);
1135    }
1136    else
1137      DelMemberFlag(member, CHFL_CHANOP);
# Line 997 | Line 1195 | chm_hop(struct Client *client_p, struct
1195      return;
1196  
1197    /* no redundant mode changes */
1198 <  if (dir == MODE_ADD &&  has_member_flags(member, CHFL_HALFOP))
1198 >  if (dir == MODE_ADD &&  has_member_flags(member, CHFL_HALFOP | CHFL_CHANOP))
1199      return;
1200    if (dir == MODE_DEL && !has_member_flags(member, CHFL_HALFOP))
1201      return;
1202  
1203    mode_changes[mode_count].letter = 'h';
1204    mode_changes[mode_count].dir = dir;
1205 <  mode_changes[mode_count].caps = 0;
1205 >  mode_changes[mode_count].caps = CAP_HOPS;
1206    mode_changes[mode_count].nocaps = 0;
1207    mode_changes[mode_count].mems = ALL_MEMBERS;
1208    mode_changes[mode_count].id = targ_p->id;
1209    mode_changes[mode_count].arg = targ_p->name;
1210    mode_changes[mode_count++].client = targ_p;
1211  
1212 +  mode_changes[mode_count].letter = 'o';
1213 +  mode_changes[mode_count].dir = dir;
1214 +  mode_changes[mode_count].caps = 0;
1215 +  mode_changes[mode_count].nocaps = CAP_HOPS;
1216 +  mode_changes[mode_count].mems = ONLY_SERVERS;
1217 +  mode_changes[mode_count].id = targ_p->id;
1218 +  mode_changes[mode_count].arg = targ_p->name;
1219 +  mode_changes[mode_count++].client = targ_p;
1220 +
1221    if (dir == MODE_ADD)
1222    {
1223      AddMemberFlag(member, CHFL_HALFOP);
# Line 1230 | Line 1437 | struct ChannelMode
1437    void *d;
1438   };
1439  
1233 – /* *INDENT-OFF* */
1440   static struct ChannelMode ModeTable[255] =
1441   {
1442    {chm_nosuch, NULL},
# Line 1248 | Line 1454 | static struct ChannelMode ModeTable[255]
1454    {chm_nosuch, NULL},                             /* L */
1455    {chm_nosuch, NULL},                             /* M */
1456    {chm_nosuch, NULL},                             /* N */
1457 <  {chm_nosuch, NULL},                             /* O */
1457 >  {chm_operonly, (void *) MODE_OPERONLY},         /* O */
1458    {chm_nosuch, NULL},                             /* P */
1459    {chm_nosuch, NULL},                             /* Q */
1460    {chm_nosuch, NULL},                             /* R */
1461 <  {chm_nosuch, NULL},                             /* S */
1461 >  {chm_simple, (void *) MODE_SSLONLY},            /* S */
1462    {chm_nosuch, NULL},                             /* T */
1463    {chm_nosuch, NULL},                             /* U */
1464    {chm_nosuch, NULL},                             /* V */
# Line 1287 | Line 1493 | static struct ChannelMode ModeTable[255]
1493    {chm_op, NULL},                                 /* o */
1494    {chm_simple, (void *) MODE_PRIVATE},            /* p */
1495    {chm_nosuch, NULL},                             /* q */
1496 <  {chm_nosuch, NULL},                             /* r */
1496 >  {chm_registered, (void *) MODE_REGISTERED},     /* r */
1497    {chm_simple, (void *) MODE_SECRET},             /* s */
1498    {chm_simple, (void *) MODE_TOPICLIMIT},         /* t */
1499    {chm_nosuch, NULL},                             /* u */
# Line 1297 | Line 1503 | static struct ChannelMode ModeTable[255]
1503    {chm_nosuch, NULL},                             /* y */
1504    {chm_nosuch, NULL},                             /* z */
1505   };
1300 – /* *INDENT-ON* */
1506  
1507   /* get_channel_access()
1508   *
# Line 1354 | Line 1559 | get_channel_access(struct Client *source
1559  
1560   static void
1561   send_cap_mode_changes(struct Client *client_p, struct Client *source_p,
1562 <                      struct Channel *chptr, int cap, int nocap)
1562 >                      struct Channel *chptr, unsigned int cap, unsigned int nocap)
1563   {
1564    int i, mbl, pbl, arglen, nc, mc;
1565    int len;
# Line 1412 | Line 1617 | send_cap_mode_changes(struct Client *cli
1617          (pbl + arglen + BAN_FUDGE) >= MODEBUFLEN)
1618      {
1619        if (nc != 0)
1620 <        sendto_server(client_p, source_p, chptr, cap, nocap,
1621 <                      LL_ICHAN | LL_ICLIENT, "%s %s",
1620 >        sendto_server(client_p, chptr, cap, nocap,
1621 >                      "%s %s",
1622                        modebuf, parabuf);
1623        nc = 0;
1624        mc = 0;
# Line 1454 | Line 1659 | send_cap_mode_changes(struct Client *cli
1659      parabuf[pbl - 1] = 0;
1660  
1661    if (nc != 0)
1662 <    sendto_server(client_p, source_p, chptr, cap, nocap,
1663 <                  LL_ICLIENT, "%s %s", modebuf, parabuf);
1662 >    sendto_server(client_p, chptr, cap, nocap,
1663 >                  "%s %s", modebuf, parabuf);
1664   }
1665  
1666   /* void send_mode_changes(struct Client *client_p,

Comparing:
ircd-hybrid/src/channel_mode.c (property svn:keywords), Revision 32 by knight, Sun Oct 2 20:41:23 2005 UTC vs.
ircd-hybrid-8/src/channel_mode.c (property svn:keywords), Revision 1167 by michael, Thu Aug 11 20:13:38 2011 UTC

# Line 1 | Line 1
1 < Revision
1 > Id Revision

Diff Legend

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