Author: Ghostwolf <foxxe@wtfs.net>
[ircu2.10.12-pk.git] / ircd / whocmds.c
index 25f354519fcdb43b933cbba95a09df2a4bd52598..8bdb1ce8f36ac4038e44d9134b12abc3c9b4aedd 100644 (file)
@@ -136,7 +136,15 @@ void do_who(struct Client* sptr, struct Client* acptr, struct Channel* repchan,
 
   if (!fields || (fields & WHO_FIELD_SER))
   {
-    char *p2 = cli_name(cli_user(acptr)->server);
+    char *p2;
+#ifdef HEAD_IN_SAND_WHO_SERVERNAME
+    if (IsOper(sptr))
+#endif
+      p2 = cli_name(cli_user(acptr)->server);
+#ifdef HEAD_IN_SAND_WHO_SERVERNAME
+    else
+      p2 = HEAD_IN_SAND_SERVERNAME;
+#endif
     *(p1++) = ' ';
     while ((*p2) && (*(p1++) = *(p2++)));
   }
@@ -189,6 +197,8 @@ void do_who(struct Client* sptr, struct Client* acptr, struct Channel* repchan,
       if (SendDebug(acptr))
         *(p1++) = 'g';
     }
+    if (HasHiddenHost(acptr))
+      *(p1++) = 'x';
   }
 
   if (!fields || (fields & WHO_FIELD_DIS))
@@ -197,8 +207,7 @@ void do_who(struct Client* sptr, struct Client* acptr, struct Channel* repchan,
     if (!fields)
       *p1++ = ':';              /* Place colon here for default reply */
 #ifdef HEAD_IN_SAND_WHO_HOPCOUNT
-    strcat(p1, sptr == acptr ? "0" : "3");
-    p1++;
+    *p1++ = (sptr == acptr) ? '0' : '3';
 #else
     /* three digit hopcount maximum */
     p1 += ircd_snprintf(0, p1, 3, "%d", cli_hopcount(acptr));