X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_list.cpp;h=68a41e9ea6cf0da5a79d56bb2bf8e7a921ce1896;hb=0e7e1ea3935e48a5093be4ccf2371a344f30bba0;hp=40a5c8b59ddac9977dd35e17a74294a88baa0a7f;hpb=e915fcbc00b7ac3fbe9d7af11e4f56778f9d2200;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_list.cpp b/src/coremods/core_list.cpp index 40a5c8b59..68a41e9ea 100644 --- a/src/coremods/core_list.cpp +++ b/src/coremods/core_list.cpp @@ -1,8 +1,14 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2017-2019 Sadie Powell + * Copyright (C) 2015 Daniel Vassdal + * Copyright (C) 2013-2016 Attila Molnar + * Copyright (C) 2012 Robby * Copyright (C) 2009 Daniel De Graaf - * Copyright (C) 2007 Robin Burchell + * Copyright (C) 2008 Robin Burchell + * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2006-2007, 2010 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -41,8 +47,9 @@ class CommandList : public Command } public: - /** Constructor for list. - */ + // Whether to show modes in the LIST response. + bool showmodes; + CommandList(Module* parent) : Command(parent,"LIST", 0, 0) , secretmode(creator, "secret") @@ -179,11 +186,16 @@ CmdResult CommandList::Handle(User* user, const Params& parameters) // Channel is private (+p) and user is outside/not privileged user->WriteNumeric(RPL_LIST, '*', users, ""); } - else + else if (showmodes) { - /* User is in the channel/privileged, channel is not +s */ + // Show the list response with the modes and topic. user->WriteNumeric(RPL_LIST, chan->name, users, InspIRCd::Format("[+%s] %s", chan->ChanModes(n), chan->topic.c_str())); } + else + { + // Show the list response with just the modes. + user->WriteNumeric(RPL_LIST, chan->name, users, chan->topic); + } } } user->WriteNumeric(RPL_LISTEND, "End of channel list."); @@ -202,6 +214,12 @@ class CoreModList : public Module { } + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE + { + ConfigTag* tag = ServerInstance->Config->ConfValue("options"); + cmd.showmodes = tag->getBool("modesinlist", true); + } + void On005Numeric(std::map& tokens) CXX11_OVERRIDE { tokens["ELIST"] = "CMNTU";