summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-03-19 16:33:23 +0100
committerAttila Molnar <attilamolnar@hush.com>2016-03-19 16:33:23 +0100
commitd47b1550edf74e1b5756d6e0ed6561559b5f5162 (patch)
treea76c31ba6104987e1192680247138805a8dc70ca /src
parent1520f1d71654f45f4faec367ac02f03e27fd8960 (diff)
m_check Move DumpExt() into CheckContext
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_check.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp
index 95e063e4d..ef9507aa1 100644
--- a/src/modules/m_check.cpp
+++ b/src/modules/m_check.cpp
@@ -65,6 +65,22 @@ class CheckContext
modelist.Flush();
}
+ void DumpExt(Extensible* ext)
+ {
+ CheckContext::List extlist(*this, "metadata");
+ for(Extensible::ExtensibleStore::const_iterator i = ext->GetExtList().begin(); i != ext->GetExtList().end(); ++i)
+ {
+ ExtensionItem* item = i->first;
+ std::string value = item->serialize(FORMAT_USER, ext, i->second);
+ if (!value.empty())
+ Write("meta:" + item->name, value);
+ else if (!item->name.empty())
+ extlist.Add(item->name);
+ }
+
+ extlist.Flush();
+ }
+
class List : public Numeric::GenericBuilder<' ', false, Numeric::WriteRemoteNumericSink>
{
public:
@@ -111,22 +127,6 @@ class CommandCheck : public Command
return ret;
}
- void dumpExt(CheckContext& context, Extensible* ext)
- {
- CheckContext::List extlist(context, "metadata");
- for(Extensible::ExtensibleStore::const_iterator i = ext->GetExtList().begin(); i != ext->GetExtList().end(); i++)
- {
- ExtensionItem* item = i->first;
- std::string value = item->serialize(FORMAT_USER, ext, i->second);
- if (!value.empty())
- context.Write("meta:" + item->name, value);
- else if (!item->name.empty())
- extlist.Add(item->name);
- }
-
- extlist.Flush();
- }
-
CmdResult Handle (const std::vector<std::string> &parameters, User *user)
{
if (parameters.size() > 1 && parameters[1] != ServerInstance->Config->ServerName)
@@ -230,7 +230,7 @@ class CommandCheck : public Command
chanlist.Flush();
- dumpExt(context, targuser);
+ context.DumpExt(targuser);
}
else if (targchan)
{
@@ -268,7 +268,7 @@ class CommandCheck : public Command
for (ModeParser::ListModeList::const_iterator i = listmodes.begin(); i != listmodes.end(); ++i)
context.DumpListMode((*i)->GetList(targchan));
- dumpExt(context, targchan);
+ context.DumpExt(targchan);
}
else
{