From 986d587ea4bba1e89fc241220621d0834464ea28 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 14 May 2022 14:35:07 +0100 Subject: Add the new account system. This still relies on the old extensibles for now but we can change that later. --- src/modules/m_restrictchans.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/modules/m_restrictchans.cpp') 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) { } -- cgit v1.3.1-10-gc9f91