mirror of
https://github.com/anope/anope.git
synced 2026-07-04 06:13:11 +02:00
Alpabetize channels in /ns alist and on webcpanels chanserv page
This commit is contained in:
@@ -13,6 +13,11 @@
|
||||
|
||||
class CommandNSAList : public Command
|
||||
{
|
||||
static bool ChannelSort(ChannelInfo *ci1, ChannelInfo *ci2)
|
||||
{
|
||||
return ci::less()(ci1->name, ci2->name);
|
||||
}
|
||||
|
||||
public:
|
||||
CommandNSAList(Module *creator) : Command(creator, "nickserv/alist", 0, 2)
|
||||
{
|
||||
@@ -46,6 +51,7 @@ class CommandNSAList : public Command
|
||||
|
||||
std::deque<ChannelInfo *> queue;
|
||||
nc->GetChannelReferences(queue);
|
||||
std::sort(queue.begin(), queue.end(), ChannelSort);
|
||||
|
||||
if (queue.empty())
|
||||
{
|
||||
|
||||
@@ -7,6 +7,14 @@
|
||||
|
||||
#include "../../webcpanel.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
bool ChannelSort(ChannelInfo *ci1, ChannelInfo *ci2)
|
||||
{
|
||||
return ci::less()(ci1->name, ci2->name);
|
||||
}
|
||||
}
|
||||
|
||||
namespace WebCPanel
|
||||
{
|
||||
|
||||
@@ -17,6 +25,8 @@ void BuildChanList(NickAlias *na, TemplateFileServer::Replacements &replacements
|
||||
{
|
||||
std::deque<ChannelInfo *> queue;
|
||||
na->nc->GetChannelReferences(queue);
|
||||
std::sort(queue.begin(), queue.end(), ChannelSort);
|
||||
|
||||
for (unsigned i = 0; i < queue.size(); ++i)
|
||||
{
|
||||
ChannelInfo *ci = queue[i];
|
||||
|
||||
Reference in New Issue
Block a user