X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_list.cpp;h=bf9d9bdaef54245da6ebe2f31c74521de3662396;hb=373b0027eae733ef39e3fbb59a45e03e7907056b;hp=505b0764caa2e0fe1b82471689fb904d5abe01a2;hpb=f71e6bf9cb41811f18864f5d4eecb26e29d03f25;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_list.cpp b/src/coremods/core_list.cpp index 505b0764c..bf9d9bdae 100644 --- a/src/coremods/core_list.cpp +++ b/src/coremods/core_list.cpp @@ -68,6 +68,9 @@ CmdResult CommandList::Handle (const std::vector& parameters, User } } + const bool has_privs = user->HasPrivPermission("channels/auspex"); + const bool match_name_topic = ((!parameters.empty()) && (!parameters[0].empty()) && (parameters[0][0] != '<') && (parameters[0][0] != '>')); + const chan_hash& chans = ServerInstance->GetChans(); for (chan_hash::const_iterator i = chans.begin(); i != chans.end(); ++i) { @@ -80,14 +83,14 @@ CmdResult CommandList::Handle (const std::vector& parameters, User if (too_many || too_few) continue; - if (parameters.size() && !parameters[0].empty() && (parameters[0][0] != '<' && parameters[0][0] != '>')) + if (match_name_topic) { if (!InspIRCd::Match(i->second->name, parameters[0]) && !InspIRCd::Match(i->second->topic, parameters[0])) continue; } // if the channel is not private/secret, OR the user is on the channel anyway - bool n = (i->second->HasUser(user) || user->HasPrivPermission("channels/auspex")); + bool n = (has_privs || i->second->HasUser(user)); if (!n && i->second->IsModeSet(privatemode)) {