]> jfr.im git - irc/rakaur/praxis.git/commitdiff
Added parsing for KILL.
authorEric Will <redacted>
Wed, 18 Aug 2004 17:40:44 +0000 (17:40 +0000)
committerEric Will <redacted>
Wed, 18 Aug 2004 17:40:44 +0000 (17:40 +0000)
Fixed up m_ping() to deal with things "correctly."
Expanded some keywords.

include/irc.h
src/Makefile.in
src/core/irc.c
src/irc/m_kill.c [new file with mode: 0644]
src/irc/m_ping.c
src/irc/m_sid.c
src/irc/m_squit.c

index 0e72ce7820a178f109ab9736162af37d7f5acded..f646ff712f89260d19c16dd18671522d194cec15 100644 (file)
@@ -30,6 +30,7 @@ struct CmdHashEntry
 CmdHashEntry *irc_cmd_hash[CMD_HASH_SIZE];
 
 extern void m_error(char *, uint, char **);
+extern void m_kill(char *, uint, char **);
 extern void m_nick(char *, uint, char **);
 extern void m_pass(char *, uint, char **);
 extern void m_ping(char *, uint, char **);
index 48a918780ae08702d00ad5602cbc6b89a2f7c160..06baa26801e1d64423d804b68f98b94d047dfaf6 100644 (file)
@@ -60,6 +60,7 @@ CORE_SRCS =                   \
 
 IRC_SRCS =                     \
   irc/m_error.c                        \
+  irc/m_kill.c                 \
   irc/m_nick.c                 \
   irc/m_pass.c                 \
   irc/m_ping.c                 \
index 97aeaff413b6719cde7b5f92b25f869ea7d1085f..87005ed9cfa46b79f9d7697840f00fe80196a823 100644 (file)
@@ -235,6 +235,7 @@ ircParse(void *arg)
 static CmdHashEntry irc_commands[] =
 {
     { "ERROR",  AC_NA, 0, m_error  },
+    { "KILL",   AC_NA, 0, m_kill   },
     { "NICK",   AC_NA, 0, m_nick   },
     { "PASS",   AC_NA, 0, m_pass   },
     { "PING",   AC_NA, 0, m_ping   },
diff --git a/src/irc/m_kill.c b/src/irc/m_kill.c
new file mode 100644 (file)
index 0000000..13f04a7
--- /dev/null
@@ -0,0 +1,44 @@
+/*  praxis: services for TSora IRC networks.
+ *  src/irc/m_kill.c: Handles IRC's KILL message.
+ *
+ *  Copyright (c) 2004 Eric Will <rakaur@malkier.net>
+ *  Copyright (c) 2003-2004 shrike development team.
+ *
+ *  $Id$
+ */
+
+#include "praxis.h"
+#include "dlink.h"
+#include "balloc.h"
+#include "connection.h"
+#include "ilog.h"
+#include "irc.h"
+#include "send.h"
+#include "server.h"
+#include "uplink.h"
+#include "user.h"
+
+/* :<origin> KILL <target> :<path/reason>
+ *
+ * parv[0] = target
+ * parv[1] = path/reason (not used)
+ */
+void
+m_kill(char *origin, uint parc, char *parv[])
+{
+    if (parc > 2)
+    {
+        ilog(L_ERROR, "m_kill(): Got user kill with too few parameters");
+
+        return;
+    }
+
+    ilog(L_DEBUG2, "m_kill(): User killed: %s by %s", parv[0], origin);
+
+    if (curr_uplink->ts_version == 6)
+        userFindUIDDelete(parv[0]);
+    else
+        userFindNickDelete(parv[0]);
+
+    /* XXX - check to see if they killed our clients */
+}
index e09503b2e823e655a729ecee5174fe9bb46bcbda..983aa8e086529e56287f0ea5b585e96ba0fe4d02 100644 (file)
@@ -28,21 +28,24 @@ m_ping(char *origin, uint parc, char *parv[])
 
     if (curr_uplink->ts_version == 6)
     {
-        server_p = serverFindSID(parv[0]);
-
-        /* I'm not sure if this is a bug with ircd-ratbox or what:
-         * On the initial burst, we get a TS6 to emulate EOB.
+        /* On the initial burst, we get a TS6 to emulate EOB.
          * However, all PINGs from there on out are TS5.
          * I'm not sure if that's "the right thing to do,"
-         * but we'll try TS6 first and fall back to TS5.
+         * but we'll try TS5 first and fall back to TS6.
          * We'll also send back a TS6 PONG regardless.
          *
+         * androsyn tells me this is done because hybrid-7.1
+         * chokes on SIDs in PING... still doesn't explain
+         * the TS6 EOB PING though.
+         *
          * In the long run this doesn't matter; any
-         * activity on the line registers as a reply.
-         * But it bugs me.
+         * activity on the line registers as a reply,
+         * but it still bugs me.
          */
+        server_p = serverFindName(parv[0]);
+
         if (server_p == NULL)
-            server_p = serverFindName(parv[0]);
+            server_p = serverFindSID(parv[0]);
 
         iassert(server_p != NULL);
 
index 5ab502e2daf02dc5bd6be337f269ba577def5cb1..4edf9445b51251e3752b86121271fb9849a2781c 100644 (file)
@@ -4,7 +4,7 @@
  *  Copyright (c) 2004 Eric Will <rakaur@malkier.net>
  *  Copyright (c) 2003-2004 shrike development team.
  *
- *  $Id: m_sid.c 2 2004-06-29 05:30:31Z rakaur $
+ *  $Id$
  */
 
 #include "praxis.h"
index ada23e03806728c023c9b3454bcfa435f332e593..0d19d19b8270a814845a8c2f04ff7d3c41dedd10 100644 (file)
@@ -4,7 +4,7 @@
  *  Copyright (c) 2004 Eric Will <rakaur@malkier.net>
  *  Copyright (c) 2003-2004 shrike development team.
  *
- *  $Id: m_server.c 2 2004-06-29 05:30:31Z rakaur $
+ *  $Id$
  */
 
 #include "praxis.h"