added gnutls backend and moved backend code into new files
[ircu2.10.12-pk.git] / ircd / m_rping.c
index 4fdabd6d2f0e51d603c4519269156bd3b914743e..1db4b239174a047c2bd6d70eb4b08eaf4cdf324d 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_log.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "msg.h"
@@ -99,7 +94,7 @@
 #include "s_user.h"
 #include "send.h"
 
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 
 
 /*
@@ -151,7 +146,7 @@ int ms_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
        * if it's not for me, pass it on
        */
       if (IsMe(destination))
-       sendcmdto_one(&me, CMD_RPONG, sptr, "%s %s %s %s :%s", sptr->name,
+       sendcmdto_one(&me, CMD_RPONG, sptr, "%s %s %s %s :%s", cli_name(sptr),
                      parv[2], parv[3], parv[4], parv[5]);
       else
        sendcmdto_one(sptr, CMD_RPING, destination, "%C %s %s %s :%s",
@@ -216,7 +211,7 @@ int mo_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   if (parc > 2) {
     if ((acptr = find_match_server(parv[2])) && !IsMe(acptr)) {
-      parv[2] = acptr->name;
+      parv[2] = cli_name(acptr);
       if (3 == parc) {
         /*
          * const_cast<char*>(start_time);
@@ -240,73 +235,3 @@ int mo_rping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   return 0;
 }
-
-#if 0
-/*
- * m_rping  -- by Run
- *
- *    parv[0] = sender (sptr->name thus)
- * if sender is a person: (traveling towards start server)
- *    parv[1] = pinged server[mask]
- *    parv[2] = start server (current target)
- *    parv[3] = optional remark
- * if sender is a server: (traveling towards pinged server)
- *    parv[1] = pinged server (current target)
- *    parv[2] = original sender (person)
- *    parv[3] = start time in s
- *    parv[4] = start time in us
- *    parv[5] = the optional remark
- */
-int m_rping(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
-  struct Client *acptr;
-
-  if (!IsPrivileged(sptr))
-    return 0;
-
-  if (parc < (IsAnOper(sptr) ? (MyConnect(sptr) ? 2 : 3) : 6))
-  {
-    return need_more_params(sptr, "RPING");
-    return 0;
-  }
-  if (MyUser(sptr))
-  {
-    if (parc == 2)
-      parv[parc++] = me.name;
-    else if (!(acptr = find_match_server(parv[2])))
-    {
-      parv[3] = parv[2];
-      parv[2] = me.name;
-      parc++;
-    }
-    else
-      parv[2] = acptr->name;
-    if (parc == 3)
-      parv[parc++] = "<No client start time>";
-  }
-
-  if (IsAnOper(sptr))
-  {
-    if (hunt_server(1, cptr, sptr, "%s%s " TOK_RPING " %s %s :%s", 2, parc, parv) != /* XXX DEAD */
-        HUNTED_ISME)
-      return 0;
-    if (!(acptr = find_match_server(parv[1])) || !IsServer(acptr))
-    {
-      sendto_one(sptr, err_str(ERR_NOSUCHSERVER), me.name, parv[0], parv[1]); /* XXX DEAD */
-      return 0;
-    }
-    sendto_one(acptr, ":%s RPING %s %s %s :%s", /* XXX DEAD */
-         me.name, NumServ(acptr), sptr->name, militime(0, 0), parv[3]);
-  }
-  else
-  {
-    if (hunt_server(1, cptr, sptr, "%s%s " TOK_RPING " %s %s %s %s :%s", 1, parc, parv) /* XXX DEAD */
-        != HUNTED_ISME)
-      return 0;
-    sendto_one(cptr, ":%s RPONG %s %s %s %s :%s", me.name, parv[0], /* XXX DEAD */
-        parv[2], parv[3], parv[4], parv[5]);
-  }
-  return 0;
-}
-#endif /* 0 */
-