diff options
-rw-r--r-- | src/base.cpp | 11 | ||||
-rw-r--r-- | src/modules/m_check.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_httpd_stats.cpp | 10 |
3 files changed, 17 insertions, 10 deletions
diff --git a/src/base.cpp b/src/base.cpp index 977227440..59196fec1 100644 --- a/src/base.cpp +++ b/src/base.cpp @@ -136,17 +136,22 @@ void Extensible::doUnhookExtensions(const std::vector<ExtensionItem*>& toRemove) } } +static struct DummyExtensionItem : LocalExtItem +{ + DummyExtensionItem() : LocalExtItem("", NULL) {} + void free(void*) {} +} dummy; + Extensible::Extensible() { - extensions[NULL] = NULL; + extensions[&dummy] = NULL; } CullResult Extensible::cull() { for(ExtensibleStore::iterator i = extensions.begin(); i != extensions.end(); ++i) { - if (i->first) - i->first->free(i->second); + i->first->free(i->second); } extensions.clear(); return classbase::cull(); diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 729667fa8..df42d4608 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -40,10 +40,10 @@ class CommandCheck : public Command { ExtensionItem* item = i->first; std::string value = item->serialize(FORMAT_USER, ext, i->second); - if (value.empty()) - dumpkeys << " " << i->first; - else + if (!value.empty()) ServerInstance->DumpText(user, checkstr + " meta:" + item->key + " " + value); + else if (!item->key.empty()) + dumpkeys << " " << item->key; } if (!dumpkeys.str().empty()) ServerInstance->DumpText(user,checkstr + " metadata", dumpkeys); diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index a451f6af9..5288130ce 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -73,10 +73,10 @@ class ModuleHttpStats : public Module { ExtensionItem* item = i->first; std::string value = item->serialize(FORMAT_USER, ext, i->second); - if (value.empty()) - data << "<meta name=\"" << item->key << "\"/>"; - else + if (!value.empty()) data << "<meta name=\"" << item->key << "\">" << Sanitize(value) << "</meta>"; + else if (!item->key.empty()) + data << "<meta name=\"" << item->key << "\"/>"; } data << "</metadata>"; } @@ -144,7 +144,9 @@ class ModuleHttpStats : public Module Membership* memb = x->second; data << "<channelmember><uid>" << memb->user->uuid << "</uid><privs>" << Sanitize(c->GetAllPrefixChars(x->first)) << "</privs><modes>" - << memb->modes << "</modes></channelmember>"; + << memb->modes << "</modes>"; + DumpMeta(data, memb); + data << "</channelmember>"; } DumpMeta(data, c); |