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

Diff of /ircd-hybrid-7.3/modules/core/m_kill.c

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

revision 1135 by michael, Sun Jan 9 11:03:03 2011 UTC revision 1136 by michael, Sun May 29 18:53:45 2011 UTC
# Line 112  mo_kill(struct Client *client_p, struct Line 112  mo_kill(struct Client *client_p, struct
112    
113    if ((target_p = find_client(user)) == NULL)    if ((target_p = find_client(user)) == NULL)
114    {    {
115      /* If the user has recently changed nick, automatically      /*
116         * If the user has recently changed nick, automatically
117       * rewrite the KILL for this new nickname--this keeps       * rewrite the KILL for this new nickname--this keeps
118       * servers in synch when nick change and kill collide       * servers in synch when nick change and kill collide
119       */       */
# Line 148  mo_kill(struct Client *client_p, struct Line 149  mo_kill(struct Client *client_p, struct
149                 source_p->name, source_p->username, source_p->host,                 source_p->name, source_p->username, source_p->host,
150                 target_p->name, reason);                 target_p->name, reason);
151    
152    /* Do not change the format of this message.  There's no point in changing messages    /*
153     * that have been around for ever, for no reason.. */     * Do not change the format of this message. There's no point in changing messages
154       * that have been around for ever, for no reason..
155       */
156    sendto_realops_flags(UMODE_ALL, L_ALL,    sendto_realops_flags(UMODE_ALL, L_ALL,
157                         "Received KILL message for %s. From %s Path: %s (%s)",                         "Received KILL message for %s. From %s Path: %s (%s)",
158                         target_p->name, source_p->name, me.name, reason);                         target_p->name, source_p->name, me.name, reason);
# Line 160  mo_kill(struct Client *client_p, struct Line 163  mo_kill(struct Client *client_p, struct
163                    me.name, reason);                    me.name, reason);
164    
165    /*    /*
166    ** And pass on the message to other servers. Note, that if KILL     * And pass on the message to other servers. Note, that if KILL
167    ** was changed, the message has to be sent to all links, also     * was changed, the message has to be sent to all links, also
168    ** back.     * back.
169    ** Suicide kills are NOT passed on --SRB     * Suicide kills are NOT passed on --SRB
170    */     */
171    if (!MyConnect(target_p))    if (!MyConnect(target_p))
172    {    {
173      relay_kill(client_p, source_p, target_p, inpath, reason);      relay_kill(client_p, source_p, target_p, inpath, reason);
174        /*        /*
175        ** Set FLAGS_KILLED. This prevents exit_one_client from sending         * Set FLAGS_KILLED. This prevents exit_one_client from sending
176        ** the unnecessary QUIT for this. (This flag should never be         * the unnecessary QUIT for this. (This flag should never be
177        ** set in any other place)         * set in any other place)
178        */         */
179      SetKilled(target_p);      SetKilled(target_p);
180    }    }
181    
182    ircsprintf(buf, "Killed (%s (%s))", source_p->name, reason);    snprintf(buf, sizeof(buf), "Killed (%s (%s))", source_p->name, reason);
183    exit_client(target_p, source_p, buf);    exit_client(target_p, source_p, buf);
184  }  }
185    
# Line 195  ms_kill(struct Client *client_p, struct Line 198  ms_kill(struct Client *client_p, struct
198    const char *path;    const char *path;
199    char def_reason[] = "No reason";    char def_reason[] = "No reason";
200    
201    if (*parv[1] == '\0')    if (EmptyString(parv[1]))
202    {    {
203      sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),      sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
204                 me.name, source_p->name, "KILL");                 me.name, source_p->name, "KILL");
# Line 229  ms_kill(struct Client *client_p, struct Line 232  ms_kill(struct Client *client_p, struct
232         * not an uid, automatically rewrite the KILL for this new nickname.         * not an uid, automatically rewrite the KILL for this new nickname.
233         * --this keeps servers in synch when nick change and kill collide         * --this keeps servers in synch when nick change and kill collide
234         */         */
235      if(IsDigit(*user))  /* Somehow an uid was not found in the hash ! */      if (IsDigit(*user)) /* Somehow an uid was not found in the hash ! */
236        return;        return;
237      if((target_p = get_history(user,      if ((target_p = get_history(user,
238                         (time_t)ConfigFileEntry.kill_chase_time_limit))                         (time_t)ConfigFileEntry.kill_chase_time_limit))
239         == NULL)         == NULL)
240      {      {
# Line 239  ms_kill(struct Client *client_p, struct Line 242  ms_kill(struct Client *client_p, struct
242                   me.name, source_p->name, user);                   me.name, source_p->name, user);
243        return;        return;
244      }      }
245    
246      sendto_one(source_p,":%s NOTICE %s :KILL changed from %s to %s",      sendto_one(source_p,":%s NOTICE %s :KILL changed from %s to %s",
247                 me.name, source_p->name, user, target_p->name);                 me.name, source_p->name, user, target_p->name);
248    }    }
# Line 274  ms_kill(struct Client *client_p, struct Line 278  ms_kill(struct Client *client_p, struct
278     * local --fl     * local --fl
279     */     */
280    if (IsOper(source_p)) /* send it normally */    if (IsOper(source_p)) /* send it normally */
   {  
281      sendto_realops_flags(UMODE_ALL, L_ALL,      sendto_realops_flags(UMODE_ALL, L_ALL,
282                           "Received KILL message for %s. From %s Path: %s!%s!%s!%s %s",                           "Received KILL message for %s. From %s Path: %s!%s!%s!%s %s",
283                           target_p->name, source_p->name, source_p->servptr->name,                           target_p->name, source_p->name, source_p->servptr->name,
284                           source_p->host, source_p->username, source_p->name, reason);                           source_p->host, source_p->username, source_p->name, reason);
   }  
285    else    else
   {  
286      sendto_realops_flags(UMODE_SKILL, L_ALL,      sendto_realops_flags(UMODE_SKILL, L_ALL,
287                           "Received KILL message for %s. From %s %s",                           "Received KILL message for %s. From %s %s",
288                           target_p->name, source_p->name, reason);                           target_p->name, source_p->name, reason);
   }  
289    
290    ilog(L_INFO,"KILL From %s For %s Path %s %s",    ilog(L_INFO,"KILL From %s For %s Path %s %s",
291         source_p->name, target_p->name, source_p->name, reason);         source_p->name, target_p->name, source_p->name, reason);
# Line 295  ms_kill(struct Client *client_p, struct Line 295  ms_kill(struct Client *client_p, struct
295    
296    /* reason comes supplied with its own ()'s */    /* reason comes supplied with its own ()'s */
297    if (IsServer(source_p) && (IsHidden(source_p) || ConfigServerHide.hide_servers))    if (IsServer(source_p) && (IsHidden(source_p) || ConfigServerHide.hide_servers))
298      ircsprintf(buf, "Killed (%s %s)", me.name, reason);      snprintf(buf, sizeof(buf), "Killed (%s %s)", me.name, reason);
299    else    else
300      ircsprintf(buf, "Killed (%s %s)", source_p->name, reason);      snprintf(buf, sizeof(buf), "Killed (%s %s)", source_p->name, reason);
301    
302    exit_client(target_p, source_p, buf);    exit_client(target_p, source_p, buf);
303  }  }

Legend:
Removed from v.1135  
changed lines
  Added in v.1136

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