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

Diff of /ircd-hybrid/modules/core/m_join.c

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

revision 490 by michael, Wed Mar 1 12:53:31 2006 UTC revision 491 by michael, Wed Mar 1 14:51:05 2006 UTC
# Line 143  m_join(struct Client *client_p, struct C Line 143  m_join(struct Client *client_p, struct C
143      if (key && *key == '\0')      if (key && *key == '\0')
144        key = NULL;        key = NULL;
145    
146      if (!IsChanPrefix(*chan) || !check_channel_name(chan))      if (!check_channel_name(chan, 1))
147      {      {
148        sendto_one(source_p, form_str(ERR_BADCHANNAME),        sendto_one(source_p, form_str(ERR_BADCHANNAME),
149                   me.name, source_p->name, chan);                   me.name, source_p->name, chan);
# Line 157  m_join(struct Client *client_p, struct C Line 157  m_join(struct Client *client_p, struct C
157        continue;        continue;
158      }      }
159    
     if (strlen(chan) > LOCAL_CHANNELLEN)  
     {  
       sendto_one(source_p, form_str(ERR_BADCHANNAME),  
                  me.name, source_p->name, chan);  
       continue;  
     }  
   
160      if (!IsExemptResv(source_p) &&      if (!IsExemptResv(source_p) &&
161          !(IsOper(source_p) && ConfigFileEntry.oper_pass_resv) &&          !(IsOper(source_p) && ConfigFileEntry.oper_pass_resv) &&
162          (!hash_find_resv(chan) == ConfigChannel.restrict_channels))          (!hash_find_resv(chan) == ConfigChannel.restrict_channels))
# Line 219  m_join(struct Client *client_p, struct C Line 212  m_join(struct Client *client_p, struct C
212        }        }
213    
214        flags = CHFL_CHANOP;        flags = CHFL_CHANOP;
215          chptr = make_channel(chan);
       if ((chptr = get_or_create_channel(source_p, chan, NULL)) == NULL)  
       {  
         sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),  
                    me.name, source_p->name, chan);  
         continue;  
       }  
216      }      }
217    
218      if (!IsOper(source_p))      if (!IsOper(source_p))
# Line 320  static void Line 307  static void
307  ms_join(struct Client *client_p, struct Client *source_p,  ms_join(struct Client *client_p, struct Client *source_p,
308          int parc, char *parv[])          int parc, char *parv[])
309  {  {
310    struct Channel *chptr;    struct Channel *chptr = NULL;
311    time_t         newts;    time_t newts = 0;
312    time_t         oldts;    time_t oldts = 0;
313    static         struct Mode mode, *oldmode;    struct Mode mode, *oldmode;
314    int            args = 0;    int args = 0;
315    int            keep_our_modes = 1;    int keep_our_modes = 1;
316    int            keep_new_modes = 1;    int keep_new_modes = 1;
317    int            isnew;    int isnew = 0;
318    char           *s;    char *s = NULL;
319    const char *servername;    const char *servername = NULL;
320    
321    if (parc == 2 && !irccmp(parv[1], "0"))    if (parc == 2 && !irccmp(parv[1], "0"))
322    {    {
# Line 337  ms_join(struct Client *client_p, struct Line 324  ms_join(struct Client *client_p, struct
324      return;      return;
325    }    }
326    
327    if (parc < 4)    if (parc < 4 || *parv[2] == '&')
328      return;      return;
329    
330    if (*parv[2] == '&' || !check_channel_name(parv[2]))    if (!check_channel_name(parv[2], 0))
331      {
332        sendto_realops_flags(UMODE_DEBUG, L_ALL,
333                             "*** Too long or invalid channel name from %s: %s",
334                             client_p->name, parv[2]);
335      return;      return;
336      }
337    
338    mbuf = modebuf;    mbuf = modebuf;
339    mode.mode = mode.limit = 0;    mode.mode = mode.limit = 0;
# Line 386  ms_join(struct Client *client_p, struct Line 378  ms_join(struct Client *client_p, struct
378      }      }
379    }    }
380    
381    if ((chptr = get_or_create_channel(source_p, parv[2], &isnew)) == NULL)    if ((chptr = hash_find_channel(parv[2])) == NULL)
382      return;    /* channel name too long? */    {
383        isnew = 1;
384        chptr = make_channel(parv[2]);
385      }
386    
387    newts   = atol(parv[1]);    newts   = atol(parv[1]);
388    oldts   = chptr->channelts;    oldts   = chptr->channelts;

Legend:
Removed from v.490  
changed lines
  Added in v.491

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