Substitute HIS_SERVERNAME in KILLs; fix SF bug #1263777.
authorMichael Poole <mdpoole@troilus.org>
Fri, 19 Aug 2005 11:46:52 +0000 (11:46 +0000)
committerMichael Poole <mdpoole@troilus.org>
Fri, 19 Aug 2005 11:46:52 +0000 (11:46 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1461 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/m_kill.c
ircd/parse.c

index 219475b449355302ef6688a583177c86f4b6cfcc..a24d16813ab2e0d0c5b566e991a3d6050990ea3c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-08-19  Michael Poole <mdpoole@troilus.org>
+
+       * 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 <mdpoole@troilus.org>
+
+       * 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 <mdpoole@troilus.org>
 
        * ircd/channel.c (mode_parse_ban): Avoid overwriting part of
index a5e2b04df18f8dced6f4dabd02e74629c77439e9..d90ffe7f1dad65a5d7bed101d2530c9ea5113633 100644 (file)
@@ -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);
 }
index 40df623096346085514a7deb1485900d610568c9..84dc1be9ee0bc92e4ad89bd9ae0d2b8e2ae5f733 100644 (file)
@@ -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)
     {