* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2008 InspIRCd Development Team
* See: http://www.inspircd.org/wiki/index.php/Credits
*
* This program is free but copyrighted software; see
{
public:
- CommandSwhois (InspIRCd* Instance) : Command(Instance,"SWHOIS",'o',2)
+ CommandSwhois (InspIRCd* Instance) : Command(Instance,"SWHOIS","o",2)
{
this->source = "m_swhois.so";
syntax = "<nick> <swhois>";
return CMD_FAILURE;
}
- if (!*parameters[1])
- {
- user->WriteServ("NOTICE %s :*** SWHOIS: Whois line must be specified", user->nick);
- return CMD_FAILURE;
- }
-
std::string line;
for (int i = 1; i < pcnt; i++)
{
if (text)
{
// We already had it set...
-
if (!ServerInstance->ULine(user->server))
// Ulines set SWHOISes silently
- ServerInstance->WriteOpers("*** %s used SWHOIS to set %s's extra whois from '%s' to '%s'", user->nick, dest->nick, text->c_str(), line.c_str());
+ ServerInstance->SNO->WriteToSnoMask('A', "%s used SWHOIS to set %s's extra whois from '%s' to '%s'", user->nick, dest->nick, text->c_str(), line.c_str());
dest->Shrink("swhois");
delete text;
else if (!ServerInstance->ULine(user->server))
{
// Ulines set SWHOISes silently
- ServerInstance->WriteOpers("*** %s used SWHOIS to set %s's extra whois to '%s'", user->nick, dest->nick, line.c_str());
+ ServerInstance->SNO->WriteToSnoMask('A', "%s used SWHOIS to set %s's extra whois to '%s'", user->nick, dest->nick, line.c_str());
}
text = new std::string(line);
Event event((char*)metadata,(Module*)this,"send_metadata");
event.Send(ServerInstance);
delete metadata;
+
+ // If it's an empty swhois, unset it (not ideal, but ok)
+ if (text->empty())
+ {
+ dest->Shrink("swhois");
+ delete text;
+ }
return CMD_LOCALONLY;
}
std::string* text;
if (!dest->GetExt("swhois", text))
{
- std::string* text = new std::string(extdata);
- dest->Extend("swhois",text);
+ std::string* text2 = new std::string(extdata);
+ dest->Extend("swhois",text2);
}
}
}