X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_list.cpp;h=eb28fb89c0ffe09fbd5f21e1702ae1fd6f5dc89b;hb=7ddef68f44ecb01f891e55a680078f7857fb866f;hp=2f417bc04dbe89d926af1f685aa4c8d1ee49c542;hpb=c745072bec0708b5d1718a325e7c983836f37a6d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_list.cpp b/src/commands/cmd_list.cpp index 2f417bc04..eb28fb89c 100644 --- a/src/commands/cmd_list.cpp +++ b/src/commands/cmd_list.cpp @@ -49,8 +49,7 @@ CmdResult CommandList::Handle (const std::vector& parameters, User user->WriteNumeric(321, "%s Channel :Users Name",user->nick.c_str()); - /* Work around mIRC suckyness. YOU SUCK, KHALED! */ - if (parameters.size() == 1) + if ((parameters.size() == 1) && (!parameters[0].empty())) { if (parameters[0][0] == '<') { @@ -82,14 +81,15 @@ CmdResult CommandList::Handle (const std::vector& parameters, User // 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")); - if (!n && i->second->IsModeSet('p')) + // If we're not in the channel and +s is set on it, we want to ignore it + if (n || !i->second->IsModeSet('s')) { - /* Channel is +p and user is outside/not privileged */ - user->WriteNumeric(322, "%s * %ld :",user->nick.c_str(), users); - } - else - { - if (n || !i->second->IsModeSet('s')) + if (!n && i->second->IsModeSet('p')) + { + /* Channel is +p and user is outside/not privileged */ + user->WriteNumeric(322, "%s * %ld :",user->nick.c_str(), users); + } + else { /* User is in the channel/privileged, channel is not +s */ user->WriteNumeric(322, "%s %s %ld :[+%s] %s",user->nick.c_str(),i->second->name.c_str(),users,i->second->ChanModes(n),i->second->topic.c_str());