X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_hidelist.cpp;h=cde8371fc6293d681fbb48774dd84931d3b5f2f8;hb=3ccf0065d43db80f31c6404aeac4d65551481508;hp=f7a05ed0abdf471abf1bff3fd801d2d16bc75bf3;hpb=c2fb4e4b9d7dc6f2ecc5d8f0054350ae8c9be986;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_hidelist.cpp b/src/modules/m_hidelist.cpp index f7a05ed0a..cde8371fc 100644 --- a/src/modules/m_hidelist.cpp +++ b/src/modules/m_hidelist.cpp @@ -21,9 +21,13 @@ class ListWatcher : public ModeWatcher { + // Minimum rank required to view the list + const unsigned int minrank; + public: - ListWatcher(Module* mod, const std::string& modename) + ListWatcher(Module* mod, const std::string& modename, unsigned int rank) : ModeWatcher(mod, modename, MODETYPE_CHANNEL) + , minrank(rank) { } @@ -36,7 +40,7 @@ class ListWatcher : public ModeWatcher // If the user requesting the list is a member of the channel see if they have the // rank required to view the list Membership* memb = chan->GetUser(user); - if ((memb) && (memb->getRank() >= HALFOP_VALUE)) + if ((memb) && (memb->getRank() >= minrank)) return true; if (user->HasPrivPermission("channels/auspex")) @@ -62,7 +66,10 @@ class ModuleHideList : public Module { ConfigTag* tag = i->second; std::string modename = tag->getString("mode"); - watchers.push_back(new ListWatcher(this, modename)); + // If rank is set to 0 everyone inside the channel can view the list, + // but non-members may not + unsigned int rank = tag->getInt("rank", HALFOP_VALUE, 0); + watchers.push_back(new ListWatcher(this, modename, rank)); } }