aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_restrictchans.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-05-14 14:35:07 +0100
committerGravatar Sadie Powell2022-05-14 14:47:56 +0100
commit986d587ea4bba1e89fc241220621d0834464ea28 (patch)
tree3783ead7019d3c85d9a3a241887442c05cf56de9 /src/modules/m_restrictchans.cpp
parentRemove the old account system. (diff)
downloadinspircd++-986d587ea4bba1e89fc241220621d0834464ea28.tar.gz
inspircd++-986d587ea4bba1e89fc241220621d0834464ea28.tar.bz2
inspircd++-986d587ea4bba1e89fc241220621d0834464ea28.zip
Add the new account system.
This still relies on the old extensibles for now but we can change that later.
Diffstat (limited to 'src/modules/m_restrictchans.cpp')
-rw-r--r--src/modules/m_restrictchans.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp
index 661e7fd28..3132083d1 100644
--- a/src/modules/m_restrictchans.cpp
+++ b/src/modules/m_restrictchans.cpp
@@ -32,13 +32,13 @@ class ModuleRestrictChans final
: public Module
{
private:
+ Account::API accountapi;
AllowChans allowchans;
bool allowregistered = false;
bool CanCreateChannel(LocalUser* user, const std::string& name)
{
- const AccountExtItem* accountext = GetAccountExtItem();
- if (allowregistered && accountext && accountext->Get(user))
+ if (allowregistered && accountapi && accountapi->GetAccountName(user))
return true;
if (user->HasPrivPermission("channels/restricted-create"))
@@ -56,6 +56,7 @@ private:
public:
ModuleRestrictChans()
: Module(VF_VENDOR, "Prevents unprivileged users from creating new channels.")
+ , accountapi(this)
{
}