*/
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);
std::string ChannelList(User* source, User* dest, bool spy);
public:
/** Constructor for whois.
*/
- CommandWhois ( Module* parent) : SplitCommand(parent,"WHOIS", 1) { Penalty = 2; syntax = "<nick>{,<nick>}"; }
+ CommandWhois(Module* parent)
+ : SplitCommand(parent, "WHOIS", 1)
+ , secretmode(parent, "secret")
+ , privatemode(parent, "private")
+ , snomaskmode(parent, "snomask")
+ {
+ Penalty = 2;
+ syntax = "<nick>{,<nick>}";
+ }
+
/** Handle command.
* @param parameters The parameters to the comamnd
* @param pcnt The number of parameters passed to teh command
/* If the target is the sender, neither +p nor +s is set, or
* the channel contains the user, it is not a spy channel
*/
- if (spy != (source == dest || !(c->IsModeSet('p') || c->IsModeSet('s')) || c->HasUser(source)))
+ if (spy != (source == dest || !(c->IsModeSet(privatemode) || c->IsModeSet(secretmode)) || c->HasUser(source)))
list.append(c->GetPrefixChar(dest)).append(c->name).append(" ");
}
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
{
int userindex = 0;
unsigned long idle = 0, signon = 0;
- if (ServerInstance->Parser->LoopCall(user, this, parameters, 0))
+ if (CommandParser::LoopCall(user, this, parameters, 0))
return CMD_SUCCESS;
/*