From ce7a32a994136fa4ffd8489f8e56dde7b678ee07 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 22 Aug 2013 01:13:28 -0400 Subject: Do not have cs_access try to represent non levels access entries as levels access entries. Sometimes it cant accurately be done and it confuses people. --- modules/commands/cs_access.cpp | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'modules/commands/cs_access.cpp') diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 5d361043d..ab13b6e7d 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -43,32 +43,6 @@ class AccessChanAccess : public ChanAccess { this->level = convertTo(data); } - - static int DetermineLevel(const ChanAccess *access) - { - if (access->provider->name == "access/access") - { - const AccessChanAccess *aaccess = anope_dynamic_static_cast(access); - return aaccess->level; - } - else - { - int highest = 1; - const std::vector &privs = PrivilegeManager::GetPrivileges(); - - for (unsigned i = 0; i < privs.size(); ++i) - { - const Privilege &p = privs[i]; - if (access->ci->GetLevel(p.name) > highest && access->HasPriv(p.name)) - highest = access->ci->GetLevel(p.name); - } - - if (highest >= ACCESS_FOUNDER) - highest = ACCESS_FOUNDER - 1; - - return highest; - } - } }; class AccessAccessProvider : public AccessProvider @@ -380,7 +354,7 @@ class CommandCSAccess : public Command ListFormatter::ListEntry entry; entry["Number"] = stringify(number); - entry["Level"] = stringify(AccessChanAccess::DetermineLevel(access)); + entry["Level"] = access->AccessSerialize(); entry["Mask"] = access->mask; entry["By"] = access->creator; entry["Last seen"] = timebuf; @@ -417,7 +391,7 @@ class CommandCSAccess : public Command ListFormatter::ListEntry entry; entry["Number"] = stringify(i + 1); - entry["Level"] = stringify(AccessChanAccess::DetermineLevel(access)); + entry["Level"] = access->AccessSerialize(); entry["Mask"] = access->mask; entry["By"] = access->creator; entry["Last seen"] = timebuf; -- cgit