mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 18:49:03 -04:00
parent
17ee4cd486
commit
c4955b78dc
@ -610,6 +610,11 @@
|
||||
# banned from the server.
|
||||
xlinemessage="You're banned! Email irc@example.com with the ERROR line below for help."
|
||||
|
||||
# allowzerolimit: If enabled then allow a limit of 0 to be set on channels.
|
||||
# This is non-standard behaviour and should only be enabled if you need to
|
||||
# link with servers running 2.0. Defaults to yes.
|
||||
allowzerolimit="no"
|
||||
|
||||
# exemptchanops: exemptions for channel access restrictions based on prefix.
|
||||
exemptchanops="nonick:v flood:o"
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
ModeChannelLimit::ModeChannelLimit(Module* Creator)
|
||||
: ParamMode<ModeChannelLimit, LocalIntExt>(Creator, "limit", 'l')
|
||||
, minlimit(0)
|
||||
{
|
||||
}
|
||||
|
||||
@ -35,8 +36,8 @@ bool ModeChannelLimit::ResolveModeConflict(std::string &their_param, const std::
|
||||
|
||||
ModeAction ModeChannelLimit::OnSet(User* user, Channel* chan, std::string& parameter)
|
||||
{
|
||||
int limit = ConvToInt(parameter);
|
||||
if (limit < 0)
|
||||
size_t limit = ConvToNum<size_t>(parameter);
|
||||
if (limit < minlimit)
|
||||
return MODEACTION_DENY;
|
||||
|
||||
ext.set(chan, limit);
|
||||
|
@ -104,6 +104,11 @@ class CoreModChannel : public Module, public CheckExemption::EventListener
|
||||
exempts[restriction] = prefix;
|
||||
}
|
||||
exemptions.swap(exempts);
|
||||
|
||||
// In 2.0 we allowed limits of 0 to be set. This is non-standard behaviour
|
||||
// and will be removed in the next major release.
|
||||
limitmode.minlimit = optionstag->getBool("allowzerolimit", true) ? 0 : 1;
|
||||
|
||||
banmode.DoRehash();
|
||||
}
|
||||
|
||||
|
@ -168,6 +168,7 @@ class ModeChannelKey : public ParamMode<ModeChannelKey, LocalStringExt>
|
||||
class ModeChannelLimit : public ParamMode<ModeChannelLimit, LocalIntExt>
|
||||
{
|
||||
public:
|
||||
size_t minlimit;
|
||||
ModeChannelLimit(Module* Creator);
|
||||
bool ResolveModeConflict(std::string& their_param, const std::string& our_param, Channel* channel) CXX11_OVERRIDE;
|
||||
void SerializeParam(Channel* chan, intptr_t n, std::string& out);
|
||||
|
Loading…
x
Reference in New Issue
Block a user