summaryrefslogtreecommitdiff
path: root/modules/commands/cs_mode.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-12-19 15:37:15 -0500
committerAdam <Adam@anope.org>2011-12-19 15:37:15 -0500
commit45fc3ce1c41b06af6e03712988870ead95b72435 (patch)
tree7b574d077f77707edb3916fb43dfa30dec8b0f54 /modules/commands/cs_mode.cpp
parentd320c73f23ff7a9b848b86b59c6bf91c1254e410 (diff)
Fixed formatting of many lists and INFO outputs
Diffstat (limited to 'modules/commands/cs_mode.cpp')
-rw-r--r--modules/commands/cs_mode.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp
index 7c0f09e63..3fa80ed68 100644
--- a/modules/commands/cs_mode.cpp
+++ b/modules/commands/cs_mode.cpp
@@ -156,7 +156,9 @@ class CommandCSMode : public Command
}
else
{
- source.Reply(_("Mode locks for %s:"), ci->name.c_str());
+ ListFormatter list;
+ list.addColumn("Mode").addColumn("Param").addColumn("Creator").addColumn("Created");
+
for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = mlocks.begin(), it_end = mlocks.end(); it != it_end; ++it)
{
const ModeLock &ml = it->second;
@@ -164,11 +166,21 @@ class CommandCSMode : public Command
if (!cm)
continue;
- Anope::string modeparam = ml.param;
- if (!modeparam.empty())
- modeparam = " " + modeparam;
- source.Reply(_("%c%c%s, by %s on %s"), ml.set ? '+' : '-', cm->ModeChar, modeparam.c_str(), ml.setter.c_str(), do_strftime(ml.created).c_str());
+ ListFormatter::ListEntry entry;
+ entry["Mode"] = Anope::printf("%c%c", ml.set ? '+' : '-', cm->ModeChar);
+ entry["Param"] = ml.param;
+ entry["Creator"] = ml.setter;
+ entry["Created"] = do_strftime(ml.created, source.u->Account(), false);
+ list.addEntry(entry);
}
+
+ source.Reply(_("Mode locks for %s:"), ci->name.c_str());
+
+ std::vector<Anope::string> replies;
+ list.Process(replies);
+
+ for (unsigned i = 0; i < replies.size(); ++i)
+ source.Reply(replies[i]);
}
}
else