1
0
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:
Adam
2013-09-08 04:55:03 -04:00
parent b005089f2f
commit f63e4ceebe
2 changed files with 16 additions and 0 deletions
+6
View File
@@ -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];