aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-08-24 04:49:49 +0100
committerGravatar Sadie Powell2022-08-24 04:52:45 +0100
commit87fe3cae8aa28ceacc7d20afa1d535630d03bc02 (patch)
treed98fee098ff3f309b34206be37626d5cdb866305 /src/modules
parentKill some unnecessary misspell-fixer ignore entries. (diff)
downloadinspircd++-87fe3cae8aa28ceacc7d20afa1d535630d03bc02.tar.gz
inspircd++-87fe3cae8aa28ceacc7d20afa1d535630d03bc02.tar.bz2
inspircd++-87fe3cae8aa28ceacc7d20afa1d535630d03bc02.zip
Replace GetUserCounter() with GetUsers().size().
This method is legacy from when there was a manual user counter and isn't much of a length saving over the unsugared version.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_banredirect.cpp2
-rw-r--r--src/modules/m_channames.cpp2
-rw-r--r--src/modules/m_check.cpp2
-rw-r--r--src/modules/m_httpd_stats.cpp2
-rw-r--r--src/modules/m_override.cpp2
-rw-r--r--src/modules/m_redirect.cpp2
6 files changed, 6 insertions, 6 deletions
diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp
index 9b8eb2fe0..b0b1064b5 100644
--- a/src/modules/m_banredirect.cpp
+++ b/src/modules/m_banredirect.cpp
@@ -333,7 +333,7 @@ public:
if (destchan)
destlimit = destchan->GetModeParameter(limitmode);
- if(destchan && destchan->IsModeSet(redirectmode) && !destlimit.empty() && (destchan->GetUserCounter() >= ConvToNum<size_t>(destlimit)))
+ if(destchan && destchan->IsModeSet(redirectmode) && !destlimit.empty() && (destchan->GetUsers().size() >= ConvToNum<size_t>(destlimit)))
{
user->WriteNumeric(ERR_BANNEDFROMCHAN, chan->name, "Cannot join channel (you're banned)");
return MOD_RES_DENY;
diff --git a/src/modules/m_channames.cpp b/src/modules/m_channames.cpp
index 7e88ee38a..b12ce085e 100644
--- a/src/modules/m_channames.cpp
+++ b/src/modules/m_channames.cpp
@@ -75,7 +75,7 @@ public:
if (ServerInstance->Channels.IsChannel(c->name))
continue; // The name of this channel is still valid
- if (c->IsModeSet(permchannelmode) && c->GetUserCounter())
+ if (c->IsModeSet(permchannelmode) && !c->GetUsers().empty())
{
removepermchan.clear();
removepermchan.push_remove(*permchannelmode);
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 22422d16e..ede792d42 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -256,7 +256,7 @@ public:
}
context.Write("modes", targetchan->ChanModes(true));
- context.Write("membercount", ConvToStr(targetchan->GetUserCounter()));
+ context.Write("membercount", ConvToStr(targetchan->GetUsers().size()));
for (const auto& [u, memb] : targetchan->GetUsers())
{
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index c96566f8d..09d72cac5 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -220,7 +220,7 @@ namespace Stats
{
serializer.BeginBlock("channel")
.Attribute("channelname", c->name)
- .Attribute("usercount", c->GetUserCounter())
+ .Attribute("usercount", c->GetUsers().size())
.Attribute("channelmodes",c->ChanModes(true));
if (!c->topic.empty())
diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp
index 59e2b48a3..72fa45817 100644
--- a/src/modules/m_override.cpp
+++ b/src/modules/m_override.cpp
@@ -255,7 +255,7 @@ public:
if (chan->IsModeSet(key) && (CanOverride(user,"KEY")) && keygiven != chan->GetModeParameter(key))
return HandleJoinOverride(user, chan, keygiven, "the channel key", "+k");
- if (chan->IsModeSet(limit) && (chan->GetUserCounter() >= ConvToNum<size_t>(chan->GetModeParameter(limit))) && (CanOverride(user,"LIMIT")))
+ if (chan->IsModeSet(limit) && (chan->GetUsers().size() >= ConvToNum<size_t>(chan->GetModeParameter(limit))) && (CanOverride(user,"LIMIT")))
return HandleJoinOverride(user, chan, keygiven, "the channel limit", "+l");
if (chan->IsBanned(user) && CanOverride(user,"BANWALK"))
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index 2d61de8c1..8f5e3f078 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -104,7 +104,7 @@ public:
{
if (chan->IsModeSet(re) && chan->IsModeSet(limitmode))
{
- if (chan->GetUserCounter() >= ConvToNum<size_t>(chan->GetModeParameter(limitmode)))
+ if (chan->GetUsers().size() >= ConvToNum<size_t>(chan->GetModeParameter(limitmode)))
{
const std::string& channel = *re.ext.Get(chan);