Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / m_userhost.c
index cf862e94ba5664b0004dec9a1927d10068155489..0d49fceb3b902dc0424b4abe860eb21b57e31c0d 100644 (file)
@@ -82,6 +82,7 @@
 #include "config.h"
 
 #include "client.h"
+#include "ircd_log.h"
 #include "ircd_reply.h"
 #include "ircd_string.h"
 #include "msgq.h"
 #include "s_user.h"
 #include "struct.h"
 
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
 
-static void userhost_formatter(struct Client* cptr, struct MsgBuf* mb)
+static void userhost_formatter(struct Client* cptr, struct Client *sptr, struct MsgBuf* mb)
 {
   assert(IsUser(cptr));
   msgq_append(0, mb, "%s%s=%c%s@%s", cli_name(cptr),
-             HasPriv(cptr, PRIV_DISPLAY) ? "*" : "",
+              SeeOper(sptr,cptr) ? "*" : "",
              cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username,
-             cli_user(cptr)->host);
+             HasHiddenHost(cptr) && !IsAnOper(sptr) && (sptr != cptr) ?
+             cli_user(cptr)->host : cli_user(cptr)->realhost);
 }
 
 /*