diff options
author | Adam <Adam@anope.org> | 2013-08-22 01:13:28 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-08-22 01:13:28 -0400 |
commit | ce7a32a994136fa4ffd8489f8e56dde7b678ee07 (patch) | |
tree | 935122b9d5b38067dc3759f618f24c9b8705b72c /modules/commands/cs_access.cpp | |
parent | 0c1cc08e2832dbe59b5aaa9b654a11bafb373ab6 (diff) |
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.
Diffstat (limited to 'modules/commands/cs_access.cpp')
-rw-r--r-- | modules/commands/cs_access.cpp | 30 |
1 files changed, 2 insertions, 28 deletions
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<int>(data); } - - static int DetermineLevel(const ChanAccess *access) - { - if (access->provider->name == "access/access") - { - const AccessChanAccess *aaccess = anope_dynamic_static_cast<const AccessChanAccess *>(access); - return aaccess->level; - } - else - { - int highest = 1; - const std::vector<Privilege> &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; |