From dd02dedabb04213291462bfaf2f28f6134fc0e37 Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Fri, 19 Aug 2005 11:46:52 +0000 Subject: [PATCH] Substitute HIS_SERVERNAME in KILLs; fix SF bug #1263777. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1461 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 11 +++++++++++ ircd/m_kill.c | 6 +++--- ircd/parse.c | 11 +++++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 219475b..a24d168 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-08-19 Michael Poole + + * ircd/parse.c (tok_tree): Re-add token tree structure. + (initmsgtree): Populate it. + (parse_server): Prefer it to full message tree. + +2005-08-18 Michael Poole + + * ircd/m_kill.c (do_kill): When FEAT_HIS_KILLWHO, change apparent + source of KILLs to &his instead of &me. + 2005-08-16 Michael Poole * ircd/channel.c (mode_parse_ban): Avoid overwriting part of diff --git a/ircd/m_kill.c b/ircd/m_kill.c index a5e2b04..d90ffe7 100644 --- a/ircd/m_kill.c +++ b/ircd/m_kill.c @@ -151,12 +151,12 @@ static int do_kill(struct Client* cptr, struct Client* sptr, * always sees the kill as coming from me. */ if (MyConnect(victim)) - sendcmdto_one(feature_bool(FEAT_HIS_KILLWHO) ? &me : sptr, CMD_KILL, + sendcmdto_one(feature_bool(FEAT_HIS_KILLWHO) ? &his : sptr, CMD_KILL, victim, "%C :%s %s", victim, feature_bool(FEAT_HIS_KILLWHO) ? feature_str(FEAT_HIS_SERVERNAME) : cli_name(sptr), msg); return exit_client_msg(cptr, victim, feature_bool(FEAT_HIS_KILLWHO) - ? &me : sptr, "Killed (%s %s)", - feature_bool(FEAT_HIS_KILLWHO) ? + ? &his : sptr, "Killed (%s %s)", + feature_bool(FEAT_HIS_KILLWHO) ? feature_str(FEAT_HIS_SERVERNAME) : cli_name(sptr), msg); } diff --git a/ircd/parse.c b/ircd/parse.c index 40df623..84dc1be 100644 --- a/ircd/parse.c +++ b/ircd/parse.c @@ -102,6 +102,7 @@ struct MessageTree { /** Root of command lookup trie. */ static struct MessageTree msg_tree; +static struct MessageTree tok_tree; /** Array of all supported commands. */ struct Message msgtab[] = { @@ -700,11 +701,12 @@ initmsgtree(void) int i; memset(&msg_tree, 0, sizeof(msg_tree)); + memset(&tok_tree, 0, sizeof(tok_tree)); for (i = 0; msgtab[i].cmd != NULL ; i++) { add_msg_element(&msg_tree, &msgtab[i], msgtab[i].cmd); - add_msg_element(&msg_tree, &msgtab[i], msgtab[i].tok); + add_msg_element(&tok_tree, &msgtab[i], msgtab[i].tok); } } @@ -1134,7 +1136,12 @@ int parse_server(struct Client *cptr, char *buffer, char *bufend) * And for the record, this trie parser really does not care. - Dianora */ - mptr = msg_tree_parse(ch, &msg_tree); + mptr = msg_tree_parse(ch, &tok_tree); + + if (mptr == NULL) + { + mptr = msg_tree_parse(ch, &msg_tree); + } if (mptr == NULL) { -- 2.20.1