diff options
author | Peter Powell <petpow@saberuk.com> | 2017-07-24 16:51:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-24 16:51:01 +0100 |
commit | 6ad780e527094d5d1cb68af1ec326b58db182c80 (patch) | |
tree | ea49869ba451ebbeb824ee1f6496a55f75ebfaff /src/listmode.cpp | |
parent | b4c5a118dbea3403e073998eeb397316755b074a (diff) | |
parent | 60658d0bdbc8d047c3dbfc19abb005e147b5b2b9 (diff) |
Merge pull request #1221 from SaberUK/master+isupport-maxlist
Replace the deprecated MAXBANS token with MAXLIST.
Diffstat (limited to 'src/listmode.cpp')
-rw-r--r-- | src/listmode.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/listmode.cpp b/src/listmode.cpp index cd034688c..23f98bf3f 100644 --- a/src/listmode.cpp +++ b/src/listmode.cpp @@ -77,7 +77,7 @@ void ListModeBase::DoRehash() // Add the default entry. This is inserted last so if the user specifies a // wildcard record in the config it will take precedence over this entry. - chanlimits.push_back(ListLimit("*", 64)); + chanlimits.push_back(ListLimit("*", DEFAULT_LIST_SIZE)); // Most of the time our settings are unchanged, so we can avoid iterating the chanlist if (oldlimits == chanlimits) @@ -102,7 +102,7 @@ unsigned int ListModeBase::FindLimit(const std::string& channame) return it->limit; } } - return 64; + return DEFAULT_LIST_SIZE; } unsigned int ListModeBase::GetLimitInternal(const std::string& channame, ChanData* cd) @@ -121,6 +121,17 @@ unsigned int ListModeBase::GetLimit(Channel* channel) return GetLimitInternal(channel->name, cd); } +unsigned int ListModeBase::GetLowerLimit() +{ + unsigned int limit = UINT_MAX; + for (limitlist::iterator iter = chanlimits.begin(); iter != chanlimits.end(); ++iter) + { + if (iter->limit < limit) + limit = iter->limit; + } + return limit == UINT_MAX ? DEFAULT_LIST_SIZE : limit; +} + ModeAction ListModeBase::OnModeChange(User* source, User*, Channel* channel, std::string ¶meter, bool adding) { // Try and grab the list |