diff options
author | Sadie Powell <sadie@witchery.services> | 2024-02-22 17:11:46 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-02-22 17:25:47 +0000 |
commit | 3290ebd36ada5c3f698a124163191187b494c912 (patch) | |
tree | 27aefe86f07abe310068bf472e8754289d63fb6d | |
parent | c4e9c0bf8548da1bf4fe2cfe5e7f5ab101b35e52 (diff) |
GetMaxListFor: use size_t and add a default like the other fields.
-rw-r--r-- | data/anope.example.conf | 4 | ||||
-rw-r--r-- | include/protocol.h | 3 | ||||
-rw-r--r-- | modules/protocol/inspircd.cpp | 2 | ||||
-rw-r--r-- | src/protocol.cpp | 9 |
4 files changed, 6 insertions, 12 deletions
diff --git a/data/anope.example.conf b/data/anope.example.conf index 32d2a1907..dca070524 100644 --- a/data/anope.example.conf +++ b/data/anope.example.conf @@ -324,9 +324,9 @@ networkinfo #chanlen = 32 /* The maximum number of list modes settable on a channel (such as b, e, I). - * Comment out or set to 0 to disable. + * Set to 0 to disable. Defaults to 100. */ - modelistsize = 100 + #modelistsize = 100 /* * Characters allowed in nicknames. This always includes the characters described diff --git a/include/protocol.h b/include/protocol.h index 67a746b0f..cb646aa59 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -289,8 +289,7 @@ public: /** Retrieve the maximum number of list modes settable on this channel * Defaults to Config->ListSize */ - virtual unsigned GetMaxListFor(Channel *c); - virtual unsigned GetMaxListFor(Channel *c, ChannelMode *cm); + virtual size_t GetMaxListFor(Channel *c, ChannelMode *cm); virtual Anope::string NormalizeMask(const Anope::string &mask); diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp index 4702fac25..cc365892a 100644 --- a/modules/protocol/inspircd.cpp +++ b/modules/protocol/inspircd.cpp @@ -114,7 +114,7 @@ public: return maxhost ? maxhost : IRCDProto::GetMaxHost(); } - unsigned GetMaxListFor(Channel *c, ChannelMode *cm) override + size_t GetMaxListFor(Channel *c, ChannelMode *cm) override { ListLimits *limits = maxlist.Get(c); if (limits) diff --git a/src/protocol.cpp b/src/protocol.cpp index 06b654123..9856aa446 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -399,14 +399,9 @@ void IRCDProto::SendOper(User *u) u->SetMode(NULL, "OPER"); } -unsigned IRCDProto::GetMaxListFor(Channel *c) +size_t IRCDProto::GetMaxListFor(Channel *c, ChannelMode *cm) { - return c->HasMode("LBAN") ? 0 : Config->GetBlock("networkinfo")->Get<int>("modelistsize"); -} - -unsigned IRCDProto::GetMaxListFor(Channel *c, ChannelMode *cm) -{ - return GetMaxListFor(c); + return c->HasMode("LBAN") ? 0 : Config->GetBlock("networkinfo")->Get<size_t>("modelistsize", "100"); } Anope::string IRCDProto::NormalizeMask(const Anope::string &mask) |