/[svn]/ircd-hybrid-8/src/channel_mode.c
ViewVC logotype

Diff of /ircd-hybrid-8/src/channel_mode.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1174 by michael, Thu Aug 11 20:13:38 2011 UTC revision 1175 by michael, Sun Aug 14 10:47:48 2011 UTC
# Line 324  del_id(struct Channel *chptr, char *bani Line 324  del_id(struct Channel *chptr, char *bani
324    return 0;    return 0;
325  }  }
326    
327  static const struct mode_letter  const struct mode_letter chan_modes[] = {
 {  
   const unsigned int mode;  
   const unsigned char letter;  
 } flags[] = {  
328    { MODE_INVITEONLY, 'i' },    { MODE_INVITEONLY, 'i' },
329    { MODE_MODERATED,  'm' },    { MODE_MODERATED,  'm' },
330    { MODE_NOPRIVMSGS, 'n' },    { MODE_NOPRIVMSGS, 'n' },
# Line 337  static const struct mode_letter Line 333  static const struct mode_letter
333    { MODE_SECRET,     's' },    { MODE_SECRET,     's' },
334    { MODE_TOPICLIMIT, 't' },    { MODE_TOPICLIMIT, 't' },
335    { MODE_OPERONLY,   'O' },    { MODE_OPERONLY,   'O' },
336      { MODE_REGONLY,    'R' },
337    { MODE_SSLONLY,    'S' },    { MODE_SSLONLY,    'S' },
338    { 0, '\0' }    { 0, '\0' }
339  };  };
# Line 355  void Line 352  void
352  channel_modes(struct Channel *chptr, struct Client *client_p,  channel_modes(struct Channel *chptr, struct Client *client_p,
353                char *mbuf, char *pbuf)                char *mbuf, char *pbuf)
354  {  {
355    int i;    const struct mode_letter *tab = chan_modes;
356    
357    *mbuf++ = '+';    *mbuf++ = '+';
358    *pbuf = '\0';    *pbuf = '\0';
359    
360    for (i = 0; flags[i].mode; ++i)    for (; tab->mode; ++tab)
361      if (chptr->mode.mode & flags[i].mode)      if (chptr->mode.mode & tab->mode)
362        *mbuf++ = flags[i].letter;        *mbuf++ = tab->letter;
363    
364    if (chptr->mode.limit)    if (chptr->mode.limit)
365    {    {
# Line 1457  static struct ChannelMode ModeTable[255] Line 1454  static struct ChannelMode ModeTable[255]
1454    {chm_operonly, (void *) MODE_OPERONLY},         /* O */    {chm_operonly, (void *) MODE_OPERONLY},         /* O */
1455    {chm_nosuch, NULL},                             /* P */    {chm_nosuch, NULL},                             /* P */
1456    {chm_nosuch, NULL},                             /* Q */    {chm_nosuch, NULL},                             /* Q */
1457    {chm_nosuch, NULL},                             /* R */    {chm_simple, (void *) MODE_REGONLY},            /* R */
1458    {chm_simple, (void *) MODE_SSLONLY},            /* S */    {chm_simple, (void *) MODE_SSLONLY},            /* S */
1459    {chm_nosuch, NULL},                             /* T */    {chm_nosuch, NULL},                             /* T */
1460    {chm_nosuch, NULL},                             /* U */    {chm_nosuch, NULL},                             /* U */

Legend:
Removed from v.1174  
changed lines
  Added in v.1175

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28