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

Diff of /ircd-hybrid-8/modules/core/m_squit.c

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

revision 1571 by michael, Sun Jul 22 14:44:07 2012 UTC revision 1572 by michael, Wed Oct 17 20:51:15 2012 UTC
# Line 123  ms_squit(struct Client *client_p, struct Line 123  ms_squit(struct Client *client_p, struct
123           int parc, char *parv[])           int parc, char *parv[])
124  {  {
125    struct Client *target_p = NULL;    struct Client *target_p = NULL;
126    char *comment;    const char *comment = NULL;
   const char *server;  
   char def_reason[] = "No reason";  
127    
128    if (parc < 2 || EmptyString(parv[1]))    if (parc < 2 || EmptyString(parv[parc - 1]))
129      return;      return;
130    
131    server = parv[1];    if ((target_p = hash_find_server(parv[1])) == NULL)
   
   if ((target_p = hash_find_server(server)) == NULL)  
132      return;      return;
133    
134    if (!IsServer(target_p) || IsMe(target_p))    if (!IsServer(target_p) && !IsMe(target_p))
135      return;      return;
136    
137    comment = (parc > 2 && parv[2]) ? parv[2] : def_reason;    if (IsMe(target_p))
138        target_p = client_p;
139    
140    if (strlen(comment) > (size_t)REASONLEN)    comment = (parc > 2 && parv[parc - 1]) ? parv[parc - 1] : client_p->name;
     comment[REASONLEN] = '\0';  
141    
142    if (MyConnect(target_p))    if (MyConnect(target_p))
143    {    {
# Line 155  ms_squit(struct Client *client_p, struct Line 151  ms_squit(struct Client *client_p, struct
151                    me.name, target_p->name, source_p->name, comment);                    me.name, target_p->name, source_p->name, comment);
152      ilog(LOG_TYPE_IRCD, "SQUIT From %s : %s (%s)", source_p->name,      ilog(LOG_TYPE_IRCD, "SQUIT From %s : %s (%s)", source_p->name,
153           target_p->name, comment);           target_p->name, comment);
   
154     }     }
155    
156     exit_client(target_p, source_p, comment);     exit_client(target_p, source_p, comment);

Legend:
Removed from v.1571  
changed lines
  Added in v.1572

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