Author: beware (by Spike)
[ircu2.10.12-pk.git] / ircd / m_userhost.c
index cf862e94ba5664b0004dec9a1927d10068155489..04055d3df5594d4542846e201765b8616e8b47d2 100644 (file)
 
 #include <assert.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) ?
+             cli_user(cptr)->host : cli_user(cptr)->realhost);
 }
 
 /*