ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/modules/core/m_squit.c
(Generate patch)

Comparing ircd-hybrid-8/modules/core/m_squit.c (file contents):
Revision 1474 by michael, Sun Jul 22 14:44:07 2012 UTC vs.
Revision 1572 by michael, Wed Oct 17 20:51:15 2012 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines