this->nickname = nick.c_str();
}
- ~SVSHold()
- {
- }
-
bool Matches(User *u)
{
if (u->nick == nickname)
return false;
}
- void DisplayExpiry()
- {
- ServerInstance->SNO->WriteToSnoMask('x',"Removing expired SVSHOLD %s (set by %s %ld seconds ago)",
- this->nickname.c_str(), this->source.c_str(), (long int)(ServerInstance->Time() - this->set_time));
- }
-
const char* Displayable()
{
return nickname.c_str();
}
else
{
- // Adding - XXX todo make this respect <insane> tag perhaps..
- long duration = ServerInstance->Duration(parameters[1]);
+ if (parameters.size() < 3)
+ return CMD_FAILURE;
+
+ unsigned long duration = InspIRCd::Duration(parameters[1]);
SVSHold* r = new SVSHold(ServerInstance->Time(), duration, user->nick.c_str(), parameters[2].c_str(), parameters[0].c_str());
if (ServerInstance->XLines->AddLine(r, user))
public:
ModuleSVSHold() : cmd(this)
+ {
+ }
+
+ void init()
{
ServerInstance->XLines->RegisterFactory(&s);
- ServerInstance->AddCommand(&cmd);
+ ServerInstance->Modules->AddService(cmd);
Implementation eventlist[] = { I_OnUserPreNick, I_OnStats };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
-
virtual ModResult OnStats(char symbol, User* user, string_list &out)
{
if(symbol != 'S')