aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_repeat.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-05-09 22:45:40 +0100
committerGravatar Sadie Powell2021-05-10 01:46:51 +0100
commitecabf153d01b4cb48944155a638e1cf4c1d80d98 (patch)
tree8a1b2773847c0a9bf6ffefff2ae1b8ef4ff95df5 /src/modules/m_repeat.cpp
parentSwitch Channel::ChanModes to use the channel mode map. (diff)
Add a new map-based method for building link data.
The new link data is not currently used but will be in the near future.
Diffstat (limited to 'src/modules/m_repeat.cpp')
-rw-r--r--src/modules/m_repeat.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp
index 507b23293..bcbe18a5a 100644
--- a/src/modules/m_repeat.cpp
+++ b/src/modules/m_repeat.cpp
@@ -95,7 +95,6 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> >
};
std::vector<unsigned int> mx[2];
- ModuleSettings ms;
bool CompareLines(const std::string& message, const std::string& historyline, unsigned int trigger)
{
@@ -126,6 +125,7 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> >
}
public:
+ ModuleSettings ms;
SimpleExtItem<MemberInfo> MemberInfoExt;
RepeatMode(Module* Creator)
@@ -255,11 +255,6 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> >
ms.KickMessage = conf->getString("kickmessage", "Repeat flood");
}
- std::string GetModuleSettings() const
- {
- return ConvToStr(ms.MaxLines) + ":" + ConvToStr(ms.MaxSecs) + ":" + ConvToStr(ms.MaxDiff) + ":" + ConvToStr(ms.MaxBacklog);
- }
-
std::string GetKickMessage() const
{
return ms.KickMessage;
@@ -421,9 +416,15 @@ class RepeatModule : public Module
ServerInstance->Modules.SetPriority(this, I_OnUserPreMessage, PRIORITY_LAST);
}
- void GetLinkData(std::string& data) override
+ void GetLinkData(LinkData& data, std::string& compatdata) override
{
- data = rm.GetModuleSettings();
+ data["max-lines"] = ConvToStr(rm.ms.MaxLines);
+ data["max-secs"] = ConvToStr(rm.ms.MaxSecs);
+ data["max-diff"] = ConvToStr(rm.ms.MaxDiff);
+ data["max-backlog"] = ConvToStr(rm.ms.MaxBacklog);
+
+ compatdata = InspIRCd::Format("%u:%u:%u:%u", rm.ms.MaxLines, rm.ms.MaxSecs,
+ rm.ms.MaxDiff, rm.ms.MaxBacklog);
}
};