X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_userhost.cpp;h=1b34addb509b93dc36878b6d14d57e03fe476150;hb=173bc63cb59bbf19e73d1b823e3e9423c9f79860;hp=541402c10385f0d40ae31337ea3e43815521c217;hpb=f71e6bf9cb41811f18864f5d4eecb26e29d03f25;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_userhost.cpp b/src/coremods/core_userhost.cpp index 541402c10..1b34addb5 100644 --- a/src/coremods/core_userhost.cpp +++ b/src/coremods/core_userhost.cpp @@ -40,6 +40,8 @@ class CommandUserhost : public Command CmdResult CommandUserhost::Handle (const std::vector& parameters, User *user) { + const bool has_privs = user->HasPrivPermission("users/auspex"); + std::string retbuf = "302 " + user->nick + " :"; for (unsigned int i = 0; i < parameters.size(); i++) @@ -48,30 +50,17 @@ CmdResult CommandUserhost::Handle (const std::vector& parameters, U if ((u) && (u->registered == REG_ALL)) { - retbuf = retbuf + u->nick; + retbuf += u->nick; if (u->IsOper()) - retbuf = retbuf + "*"; - - retbuf = retbuf + "="; - - if (u->IsAway()) - retbuf += "-"; - else - retbuf += "+"; - - retbuf = retbuf + u->ident + "@"; - - if (user->HasPrivPermission("users/auspex")) - { - retbuf = retbuf + u->host; - } - else - { - retbuf = retbuf + u->dhost; - } + retbuf += '*'; - retbuf = retbuf + " "; + retbuf += '='; + retbuf += (u->IsAway() ? '-' : '+'); + retbuf += u->ident; + retbuf += '@'; + retbuf += (((u == user) || (has_privs)) ? u->host : u->dhost); + retbuf += ' '; } }