/[svn]/ircd-hybrid-8/modules/core/m_sjoin.c
ViewVC logotype

Diff of /ircd-hybrid-8/modules/core/m_sjoin.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 631  ms_sjoin(struct Client *client_p, struct Line 631  ms_sjoin(struct Client *client_p, struct
631   *                Then walk through turning on modes that are on in mode   *                Then walk through turning on modes that are on in mode
632   *                but were not set in oldmode.   *                but were not set in oldmode.
633   */   */
   
 static const struct mode_letter  
 {  
   unsigned int mode;  
   unsigned char letter;  
 } flags[] = {  
   { MODE_NOPRIVMSGS, 'n' },  
   { MODE_TOPICLIMIT, 't' },  
   { MODE_SECRET,     's' },  
   { MODE_MODERATED,  'm' },  
   { MODE_INVITEONLY, 'i' },  
   { MODE_PRIVATE,    'p' },  
   { MODE_REGISTERED, 'r' },  
   { MODE_OPERONLY,   'O' },  
   { MODE_SSLONLY,    'S' },  
   { 0, '\0' }  
 };  
   
634  static void  static void
635  set_final_mode(struct Mode *mode, struct Mode *oldmode)  set_final_mode(struct Mode *mode, struct Mode *oldmode)
636  {  {
637      const struct mode_letter *tab;
638    char *pbuf = parabuf;    char *pbuf = parabuf;
639    int len;    int len;
   int i;  
640    
641    *mbuf++ = '-';    *mbuf++ = '-';
642    
643    for (i = 0; flags[i].letter; i++)    for (tab = chan_modes; tab->letter; ++tab)
644    {    {
645      if ((flags[i].mode & oldmode->mode) &&      if ((tab->mode & oldmode->mode) &&
646          !(flags[i].mode & mode->mode))          !(tab->mode & mode->mode))
647        *mbuf++ = flags[i].letter;        *mbuf++ = tab->letter;
648    }    }
649    
650    if (oldmode->limit != 0 && mode->limit == 0)    if (oldmode->limit != 0 && mode->limit == 0)
# Line 681  set_final_mode(struct Mode *mode, struct Line 663  set_final_mode(struct Mode *mode, struct
663    else    else
664      *mbuf++ = '+';      *mbuf++ = '+';
665    
666    for (i = 0; flags[i].letter; i++)    for (tab = chan_modes; tab->letter; ++tab)
667    {    {
668      if ((flags[i].mode & mode->mode) &&      if ((tab->mode & mode->mode) &&
669          !(flags[i].mode & oldmode->mode))          !(tab->mode & oldmode->mode))
670        *mbuf++ = flags[i].letter;        *mbuf++ = tab->letter;
671    }    }
672    
673    if (mode->limit != 0 && oldmode->limit != mode->limit)    if (mode->limit != 0 && oldmode->limit != mode->limit)

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

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