/[svn]/ircd-hybrid-7.2/contrib/m_force.c
ViewVC logotype

Diff of /ircd-hybrid-7.2/contrib/m_force.c

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

revision 631 by michael, Wed Apr 5 19:16:50 2006 UTC revision 632 by michael, Thu Jun 1 10:53:00 2006 UTC
# Line 93  mo_forcejoin(struct Client *client_p, st Line 93  mo_forcejoin(struct Client *client_p, st
93    char mode = '\0';    char mode = '\0';
94    char sjmode = '\0';    char sjmode = '\0';
95    char *newch = NULL;    char *newch = NULL;
96    dlink_node *ptr;    dlink_node *ptr = NULL;
97    
98    if (!IsAdmin(source_p))    if (!IsAdmin(source_p))
99    {    {
# Line 176  mo_forcejoin(struct Client *client_p, st Line 176  mo_forcejoin(struct Client *client_p, st
176      if (chptr->chname[0] == '#')      if (chptr->chname[0] == '#')
177      {      {
178        if (sjmode)        if (sjmode)
179          {
180          DLINK_FOREACH (ptr, serv_list.head)          DLINK_FOREACH (ptr, serv_list.head)
181          {          {
182            struct Client *serv_p = ptr->data;            struct Client *serv_p = ptr->data;
# Line 188  mo_forcejoin(struct Client *client_p, st Line 189  mo_forcejoin(struct Client *client_p, st
189                       !IsCapable(serv_p, CAP_HOPS)) ? '@' : sjmode,                       !IsCapable(serv_p, CAP_HOPS)) ? '@' : sjmode,
190                       ID_or_name(target_p, serv_p));                       ID_or_name(target_p, serv_p));
191          }          }
192          }
193        else        else
194        {        {
195          sendto_server(target_p, target_p, chptr, CAP_TS6, NOCAPS, LL_ICLIENT,          sendto_server(target_p, target_p, chptr, CAP_TS6, NOCAPS, LL_ICLIENT,
# Line 218  mo_forcejoin(struct Client *client_p, st Line 220  mo_forcejoin(struct Client *client_p, st
220    {    {
221      newch = parv[2];      newch = parv[2];
222    
223      if (check_channel_name(newch) == 0)      if (!check_channel_name(newch, 1))
     {  
       sendto_one(source_p, form_str(ERR_BADCHANNAME),  
                  me.name, source_p->name, newch);  
       return;  
     }  
   
     /* channel name must begin with & or # */  
     if (!IsChanPrefix(*newch))  
224      {      {
225        sendto_one(source_p, form_str(ERR_BADCHANNAME),        sendto_one(source_p, form_str(ERR_BADCHANNAME),
226                   me.name, source_p->name, newch);                   me.name, source_p->name, newch);
227        return;        return;
228      }      }
229    
230      /* it would be interesting here to allow an oper      /*
231         * it would be interesting here to allow an oper
232       * to force target_p into a channel that doesn't exist       * to force target_p into a channel that doesn't exist
233       * even more so, into a local channel when we disable       * even more so, into a local channel when we disable
234       * local channels... but...       * local channels... but...
# Line 246  mo_forcejoin(struct Client *client_p, st Line 241  mo_forcejoin(struct Client *client_p, st
241        return;        return;
242      }      }
243    
244      /* newch can't be longer than CHANNELLEN */      chptr = make_channel(newch);
     if (strlen(newch) > CHANNELLEN)  
     {  
       sendto_one(source_p, form_str(ERR_BADCHANNAME),  
                  me.name, source_p->name, newch);  
       return;  
     }  
   
     chptr = get_or_create_channel(target_p, newch, NULL);  
245      add_user_to_channel(chptr, target_p, CHFL_CHANOP, NO);      add_user_to_channel(chptr, target_p, CHFL_CHANOP, NO);
246    
247      /* send out a join, make target_p join chptr */      /* send out a join, make target_p join chptr */

Legend:
Removed from v.631  
changed lines
  Added in v.632

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