Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_ping.c
index a267b6eb42626537b808e4963dc2fb2ae7245980..60e223218e61dd140610ab54ebc5ad3806eab69b 100644 (file)
 #include "send.h"
 
 #include <assert.h>
+#include <string.h>
 
 /*
  * m_ping - generic message handler
@@ -170,7 +171,7 @@ int m_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   destination = parv[2];        /* Will get NULL or pointer (parc >= 2!!) */
 
-  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, me.name)) {
+  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) {
     if ((acptr = FindServer(destination)))
       sendcmdto_one(sptr, CMD_PING, acptr, "%C :%s", sptr, destination);
     else
@@ -186,7 +187,7 @@ int m_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /* Is this supposed to be here? */
     acptr = FindClient(origin);
     if (acptr && acptr != sptr)
-      origin = cptr->name;
+      origin = cli_name(cptr);
     
     if (strlen(origin) > 64)
       origin[64] = '\0';
@@ -221,15 +222,12 @@ int ms_ping(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
     /*
      * don't bother sending the error back
      */
-#if 0
-    sendto_one(sptr, err_str(ERR_NOORIGIN), me.name, parv[0]); /* XXX DEAD */
-#endif
     return 0;
   }
   origin      = parv[1];
   destination = parv[2];        /* Will get NULL or pointer (parc >= 2!!) */
 
-  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, me.name)) {
+  if (!EmptyString(destination) && 0 != ircd_strcmp(destination, cli_name(&me))) {
     if ((acptr = FindServer(destination))) {
       /*
        * Servers can just forward the origin