public:
irc::string matchtext;
- CBan(time_t s_time, long d, std::string src, std::string re, std::string ch)
+ CBan(time_t s_time, long d, const std::string& src, const std::string& re, const std::string& ch)
: XLine(s_time, d, src, re, "CBAN")
{
this->matchtext = ch.c_str();
else
{
time_t c_requires_crap = duration + ServerInstance->Time();
- ServerInstance->SNO->WriteGlobalSno('x', "%s added timed CBan for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), ServerInstance->TimeString(c_requires_crap).c_str(), reason);
+ std::string timestr = ServerInstance->TimeString(c_requires_crap);
+ ServerInstance->SNO->WriteGlobalSno('x', "%s added timed CBan for %s, expires on %s: %s", user->nick.c_str(), parameters[0].c_str(), timestr.c_str(), reason);
}
}
else
RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
{
- return ROUTE_LOCALONLY;
+ if (IS_LOCAL(user))
+ return ROUTE_LOCALONLY; // spanningtree will send ADDLINE
+
+ return ROUTE_BROADCAST;
}
};
public:
ModuleCBan() : mycommand(this)
+ {
+ }
+
+ void init()
{
ServerInstance->XLines->RegisterFactory(&f);
- ServerInstance->AddCommand(&mycommand);
+ ServerInstance->Modules->AddService(mycommand);
Implementation eventlist[] = { I_OnUserPreJoin, I_OnStats };
- ServerInstance->Modules->Attach(eventlist, this, 2);
+ ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
}
virtual ~ModuleCBan()