/*
* InspIRCd -- Internet Relay Chat Daemon
*
- * Copyright (C) 2017-2019 Sadie Powell <sadie@witchery.services>
+ * Copyright (C) 2017-2020 Sadie Powell <sadie@witchery.services>
* Copyright (C) 2015 Daniel Vassdal <shutter@canternet.org>
* Copyright (C) 2013-2016 Attila Molnar <attilamolnar@hush.com>
* Copyright (C) 2012 Robby <robby@chatbelgie.be>
* Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
* Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
* Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
- * Copyright (C) 2006-2007, 2010 Craig Edwards <brain@inspircd.org>
+ * Copyright (C) 2005-2007, 2010 Craig Edwards <brain@inspircd.org>
*
* 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
}
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")
// 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.");
{
}
+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
+ {
+ ConfigTag* tag = ServerInstance->Config->ConfValue("options");
+ cmd.showmodes = tag->getBool("modesinlist", true);
+ }
+
void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
{
tokens["ELIST"] = "CMNTU";