From a59ed4b39443eb788c15c65501898ca374387e2e Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 18 Jan 2021 06:56:18 +0000 Subject: Add a new runtime directory and move the pid file to it. The data directory is intended for persistent files whereas the pid file is ephemeral. This distinction doesn't matter by default but on system-wide installs ephemeral runtime files go in /var/run or /run instead. --- docs/conf/inspircd.conf.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example index 3d16d4eba..06ad9669d 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -531,8 +531,8 @@ # rehash the ircd from the shell or to terminate the ircd from the # # shell using shell scripts, perl scripts, etc... and to monitor the # # ircd's state via cron jobs. If this is a relative path, it will be # -# relative to the configuration directory, and if it is not defined, # -# the default of 'inspircd.pid' is used. # +# relative to the runtime directory, and if it is not defined, the # +# default of 'inspircd.pid' is used. # # # # -- cgit v1.3.1-10-gc9f91 From 6223be60dee0aa4f69b53b102a9d1aadd0dde047 Mon Sep 17 00:00:00 2001 From: iwalkalone Date: Mon, 18 Jan 2021 08:22:44 +0100 Subject: Implemented configurable kick message for the repeat module (#1835). --- docs/conf/modules.conf.example | 8 +++++++- src/modules/m_repeat.cpp | 10 +++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 0a85ef5ca..2f38f52a4 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1900,7 +1900,13 @@ # less CPU usage. Increasing this beyond 512 doesn't have # any effect, as the maximum length of a message on IRC # cannot exceed that. -# +# kickmessage - Kick message when * is specified +# # #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp index 89f5a1291..e6568732b 100644 --- a/src/modules/m_repeat.cpp +++ b/src/modules/m_repeat.cpp @@ -90,6 +90,7 @@ class RepeatMode : public ParamMode > unsigned int MaxBacklog; unsigned int MaxDiff; unsigned int MaxMessageSize; + std::string KickMessage; ModuleSettings() : MaxLines(0), MaxSecs(0), MaxBacklog(0), MaxDiff() { } }; @@ -251,6 +252,8 @@ class RepeatMode : public ParamMode > if (newsize > ServerInstance->Config->Limits.MaxLine) newsize = ServerInstance->Config->Limits.MaxLine; Resize(newsize); + + ms.KickMessage = conf->getString("kickmessage", "Repeat flood"); } std::string GetModuleSettings() const @@ -258,6 +261,11 @@ class RepeatMode : public ParamMode > return ConvToStr(ms.MaxLines) + ":" + ConvToStr(ms.MaxSecs) + ":" + ConvToStr(ms.MaxDiff) + ":" + ConvToStr(ms.MaxBacklog); } + std::string GetKickMessage() const + { + return ms.KickMessage; + } + void SerializeParam(Channel* chan, const ChannelSettings* chset, std::string& out) { chset->serialize(out); @@ -402,7 +410,7 @@ class RepeatModule : public Module ServerInstance->Modes->Process(ServerInstance->FakeClient, chan, NULL, changelist); } - memb->chan->KickUser(ServerInstance->FakeClient, user, "Repeat flood"); + memb->chan->KickUser(ServerInstance->FakeClient, user, rm.GetKickMessage()); return MOD_RES_DENY; } return MOD_RES_PASSTHRU; -- cgit v1.3.1-10-gc9f91