1 ircu uses nick chasing for whowas, but also for targetting /kill, /kick, /mode o/v, in case a nick isnt found, the whowas history is check and the intented victim is chased (time limit is 30 seconds)
3 example without this patch:
5 00:01 > MODE oldnick +w
6 00:01 < oldnick!user@host NICK newnick
7 00:01 < irc.quakenet.org 403 newnick oldnick :no such channel
8 usermode change failed because of the nick change getting in the way
10 example with this patch:
12 00:01 > MODE oldnick +w
13 00:01 < oldnick!user@host NICK newnick
14 00:01 < newnick!user@host MODE newnick +w
15 usermode change succeeded because ircd uses whowas history and found the previous user with this nick was this user
16 much friendlier and simply achieved by using information already available
18 diff -r ec3841c774be include/channel.h
19 --- a/include/channel.h Sun Jan 11 22:38:38 2009 +0000
20 +++ b/include/channel.h Sun Jan 11 22:38:38 2009 +0000
22 extern void make_zombie(struct Membership* member, struct Client* who,
23 struct Client* cptr, struct Client* sptr,
24 struct Channel* chptr);
25 -extern struct Client* find_chasing(struct Client* sptr, const char* user, int* chasing);
26 +extern struct Client* find_chasing(struct Client* sptr, const char* user, int* chasing, int error);
27 void add_invite(struct Client *cptr, struct Channel *chptr);
28 int number_of_zombies(struct Channel *chptr);
30 diff -r ec3841c774be ircd/channel.c
31 --- a/ircd/channel.c Sun Jan 11 22:38:38 2009 +0000
32 +++ b/ircd/channel.c Sun Jan 11 22:38:38 2009 +0000
34 * @param user a string representing the client to be found
35 * @param chasing a variable set to 0 if the user was found directly,
37 + * @param error send error to source when set to 1, else not
38 * @returns a pointer the client, or NULL if the client wasn't found.
40 -struct Client* find_chasing(struct Client* sptr, const char* user, int* chasing)
41 +struct Client* find_chasing(struct Client* sptr, const char* user, int* chasing, int error)
43 struct Client* who = FindClient(user);
48 if (!(who = get_history(user, feature_int(FEAT_KILLCHASETIMELIMIT)))) {
49 - send_reply(sptr, ERR_NOSUCHNICK, user);
51 + send_reply(sptr, ERR_NOSUCHNICK, user);
56 oplevel = req_oplevel;
58 /* find client we're manipulating */
59 - acptr = find_chasing(state->sptr, t_str, NULL);
60 + acptr = find_chasing(state->sptr, t_str, NULL,1);
62 if (t_str[5] == ':') {
64 diff -r ec3841c774be ircd/m_kick.c
65 --- a/ircd/m_kick.c Sun Jan 11 22:38:38 2009 +0000
66 +++ b/ircd/m_kick.c Sun Jan 11 22:38:38 2009 +0000
68 || !IsChanOp(member2))
69 return send_reply(sptr, ERR_CHANOPRIVSNEEDED, name);
71 - if (!(who = find_chasing(sptr, parv[2], 0)))
72 + if (!(who = find_chasing(sptr, parv[2], 0,1)))
73 return 0; /* find_chasing sends the reply for us */
75 /* Don't allow the channel service to be kicked */
76 diff -r ec3841c774be ircd/m_mode.c
77 --- a/ircd/m_mode.c Sun Jan 11 22:38:38 2009 +0000
78 +++ b/ircd/m_mode.c Sun Jan 11 22:38:38 2009 +0000
82 acptr = FindUser(parv[1]);
84 + if (!(acptr = find_chasing(sptr, parv[1], 0,0)))
86 send_reply(sptr, ERR_NOSUCHCHANNEL, parv[1]);