X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_list.cpp;h=67829a55edf472715d7075e5c592ede7c6f2612a;hb=5d3b755cab8e436bf7ffebaa051cde9d6e2a0997;hp=745f019f2274c518fe6e2f2df216bb25b1b9758b;hpb=d96e7e97f9036c5ce4cba10d917bf8a66e87654c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_list.cpp b/src/coremods/core_list.cpp index 745f019f2..67829a55e 100644 --- a/src/coremods/core_list.cpp +++ b/src/coremods/core_list.cpp @@ -53,7 +53,7 @@ CmdResult CommandList::Handle (const std::vector& parameters, User { int minusers = 0, maxusers = 0; - user->WriteNumeric(RPL_LISTSTART, "Channel :Users Name"); + user->WriteNumeric(RPL_LISTSTART, "Channel", "Users Name"); /* Work around mIRC suckyness. YOU SUCK, KHALED! */ if (parameters.size() == 1) @@ -94,21 +94,22 @@ 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 = (has_privs || chan->HasUser(user)); - if ((!n) && (chan->IsModeSet(privatemode))) + // If we're not in the channel and +s is set on it, we want to ignore it + if ((n) || (!chan->IsModeSet(secretmode))) { - /* Channel is +p and user is outside/not privileged */ - user->WriteNumeric(RPL_LIST, "* %ld :", users); - } - else - { - if ((n) || (!chan->IsModeSet(secretmode))) + if ((!n) && (chan->IsModeSet(privatemode))) + { + // Channel is private (+p) and user is outside/not privileged + user->WriteNumeric(RPL_LIST, '*', users, ""); + } + else { /* User is in the channel/privileged, channel is not +s */ - user->WriteNumeric(RPL_LIST, "%s %ld :[+%s] %s", chan->name.c_str(), users, chan->ChanModes(n), chan->topic.c_str()); + user->WriteNumeric(RPL_LIST, chan->name, users, InspIRCd::Format("[+%s] %s", chan->ChanModes(n), chan->topic.c_str())); } } } - user->WriteNumeric(RPL_LISTEND, ":End of channel list."); + user->WriteNumeric(RPL_LISTEND, "End of channel list."); return CMD_SUCCESS; }