X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_whois.cpp;h=0df6b65f0e8cde5dd8db2393c93f5c6c5b0ae80d;hb=dafa2f3031c4abc7f5506385770c4fc743669b17;hp=4893c125170d976dc96c5ca2651533ab6c6cff1f;hpb=b954283ccc4253a6881513bbe7f743c39886d3b7;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp index 4893c1251..0df6b65f0 100644 --- a/src/commands/cmd_whois.cpp +++ b/src/commands/cmd_whois.cpp @@ -30,6 +30,7 @@ class CommandWhois : public SplitCommand { ChanModeReference secretmode; ChanModeReference privatemode; + UserModeReference snomaskmode; void SplitChanList(User* source, User* dest, const std::string& cl); void DoWhois(User* user, User* dest, unsigned long signon, unsigned long idle); @@ -42,6 +43,7 @@ class CommandWhois : public SplitCommand : SplitCommand(parent, "WHOIS", 1) , secretmode(parent, "secret") , privatemode(parent, "private") + , snomaskmode(parent, "snomask") { Penalty = 2; syntax = "{,}"; @@ -161,9 +163,9 @@ void CommandWhois::DoWhois(User* user, User* dest, unsigned long signon, unsigne if (user == dest || user->HasPrivPermission("users/auspex")) { - if (dest->IsModeSet('s') != 0) + if (dest->IsModeSet(snomaskmode)) { - ServerInstance->SendWhoisLine(user, dest, 379, "%s %s :is using modes +%s +%s", user->nick.c_str(), dest->nick.c_str(), dest->FormatModes(), dest->FormatNoticeMasks().c_str()); + ServerInstance->SendWhoisLine(user, dest, 379, "%s %s :is using modes +%s %s", user->nick.c_str(), dest->nick.c_str(), dest->FormatModes(), snomaskmode->GetUserParameter(dest).c_str()); } else { @@ -171,7 +173,7 @@ void CommandWhois::DoWhois(User* user, User* dest, unsigned long signon, unsigne } } - FOREACH_MOD(I_OnWhois,OnWhois(user,dest)); + FOREACH_MOD(OnWhois, (user,dest)); /* * We only send these if we've been provided them. That is, if hidewhois is turned off, and user is local, or @@ -194,7 +196,7 @@ CmdResult CommandWhois::HandleRemote(const std::vector& parameters, if (!user) return CMD_FAILURE; - unsigned long idle = ConvToInt(parameters[1]); + unsigned long idle = ConvToInt(parameters.back()); DoWhois(user, target, target->signon, idle); return CMD_SUCCESS;