#include "inspircd.h"
+#include "modules/exemption.h"
class ChannelSettings
{
ConfigTag* conf = ServerInstance->Config->ConfValue("repeat");
ms.MaxLines = conf->getInt("maxlines", 20);
ms.MaxBacklog = conf->getInt("maxbacklog", 20);
- ms.MaxSecs = conf->getInt("maxsecs", 0);
+ ms.MaxSecs = conf->getDuration("maxtime", conf->getInt("maxsecs", 0));
ms.MaxDiff = conf->getInt("maxdistance", 50);
if (ms.MaxDiff > 100)
class RepeatModule : public Module
{
+ CheckExemption::EventProvider exemptionprov;
RepeatMode rm;
public:
- RepeatModule() : rm(this) {}
+ RepeatModule()
+ : exemptionprov(this)
+ , rm(this)
+ {
+ }
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
{
if (!memb)
return MOD_RES_PASSTHRU;
- if (ServerInstance->OnCheckExemption(user, chan, "repeat") == MOD_RES_ALLOW)
+ ModResult res;
+ FIRST_MOD_RESULT_CUSTOM(exemptionprov, CheckExemption::EventListener, OnCheckExemption, res, (user, chan, "repeat"));
+ if (res == MOD_RES_ALLOW)
return MOD_RES_PASSTHRU;
if (rm.MatchLine(memb, settings, text))