+ AllowChans allowchans;
+ bool allowregistered;
+
+ bool CanCreateChannel(LocalUser* user, const std::string& name)
+ {
+ const AccountExtItem* accountext = GetAccountExtItem();
+ if (allowregistered && accountext && accountext->get(user))
+ return true;
+
+ if (user->HasPrivPermission("channels/restricted-create"))
+ return true;
+
+ for (AllowChans::const_iterator it = allowchans.begin(), it_end = allowchans.end(); it != it_end; ++it)
+ {
+ if (InspIRCd::Match(name, *it))
+ return true;
+ }
+
+ return false;
+ }