Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_version.c
index 6bbc79502457a923b05b62cce8cfb9ab5ec522b6..082deefcfaa1160920fe78fec36148dc70996b05 100644 (file)
  *            note:   it is guaranteed that parv[0]..parv[parc-1] are all
  *                    non-NULL pointers.
  */
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
+#include "config.h"
+
 #include "client.h"
 #include "hash.h"
 #include "ircd.h"
+#include "ircd_features.h"
+#include "ircd_policy.h"
 #include "ircd_reply.h"
+#include "ircd_snprintf.h"
 #include "ircd_string.h"
 #include "msg.h"
 #include "numeric.h"
@@ -123,14 +120,15 @@ int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     parv[1] = cli_name(acptr);
   }
 
-  if (hunt_server_cmd(sptr, CMD_VERSION, cptr, 0, ":%C", 1, parc, parv) ==
-      HUNTED_ISME)
+  if (hunt_server_cmd(sptr, CMD_VERSION, cptr, HEAD_IN_SAND_REMOTE, ":%C", 1,
+                     parc, parv) == HUNTED_ISME)
   {
     char featurebuf[512];
     
-    sprintf_irc(featurebuf,FEATURES,FEATURESVALUES);
+    ircd_snprintf(0, featurebuf, sizeof(featurebuf), FEATURES, FEATURESVALUES);
     
-    send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me), serveropts);
+    send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
+              debug_serveropts());
     send_reply(sptr, RPL_ISUPPORT, featurebuf);
   }
 
@@ -160,39 +158,9 @@ int ms_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   if (hunt_server_cmd(sptr, CMD_VERSION, cptr, 0, ":%C", 1, parc, parv) ==
       HUNTED_ISME)
   {
-    send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me), serveropts);
+    send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
+              debug_serveropts());
   }
 
   return 0;
 }
-
-#if 0
-/*
- * m_version
- *
- *   parv[0] = sender prefix
- *   parv[1] = remote server
- */
-int m_version(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Client *acptr;
-
-  if (MyConnect(sptr) && parc > 1)
-  {
-    if (!(acptr = find_match_server(parv[1])))
-    {
-      sendto_one(sptr, err_str(ERR_NOSUCHSERVER), me.name, parv[0], parv[1]); /* XXX DEAD */
-      return 0;
-    }
-    parv[1] = acptr->name;
-  }
-
-  if (hunt_server(0, cptr, sptr, "%s%s " TOK_VERSION " :%s", 1, parc, parv) == /* XXX DEAD */
-      HUNTED_ISME)
-    sendto_one(sptr, rpl_str(RPL_VERSION), /* XXX DEAD */
-        me.name, parv[0], version, debugmode, me.name, serveropts);
-
-  return 0;
-}
-#endif /* 0 */
-