summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-13 20:33:41 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-13 20:33:41 +0000
commit75a158fe6361319628f6145b7b3b3458c55ac85a (patch)
tree0df345feae05479377d2e06d933702dfa5fa9c77 /src/modules
parent2307fd05b237b01e956e89de0a90613c6fdbfd78 (diff)
Fix automated metadata decoding with ExtItem
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11715 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_services_account.cpp4
-rw-r--r--src/modules/m_spanningtree/metadata.cpp5
-rw-r--r--src/modules/m_sslinfo.cpp12
3 files changed, 13 insertions, 8 deletions
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index ac71a1215..dea382452 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -254,9 +254,9 @@ class ModuleServicesAccount : public Module
// check if its our metadata key, and its associated with a user
if (dest && (extname == "accountname"))
{
- if (!extdata.empty())
+ std::string *account = accountname.get(dest);
+ if (account && !account->empty())
{
- std::string *account = accountname.get(dest);
trim(*account);
if (IS_LOCAL(dest))
diff --git a/src/modules/m_spanningtree/metadata.cpp b/src/modules/m_spanningtree/metadata.cpp
index f012568f9..40a98d93b 100644
--- a/src/modules/m_spanningtree/metadata.cpp
+++ b/src/modules/m_spanningtree/metadata.cpp
@@ -28,6 +28,7 @@ bool TreeSocket::MetaData(const std::string &prefix, parameterlist &params)
else if (params.size() < 3)
params.push_back("");
TreeServer* ServerSource = Utils->FindServer(prefix);
+ ExtensionItem* item = Extensible::GetItem(params[1]);
if (ServerSource)
{
if (params[0] == "*")
@@ -39,6 +40,8 @@ bool TreeSocket::MetaData(const std::string &prefix, parameterlist &params)
Channel* c = this->ServerInstance->FindChan(params[0]);
if (c)
{
+ if (item)
+ item->unserialize(FORMAT_NETWORK, c, params[2]);
FOREACH_MOD_I(this->ServerInstance,I_OnDecodeMetaData,OnDecodeMetaData(c,params[1],params[2]));
}
}
@@ -47,6 +50,8 @@ bool TreeSocket::MetaData(const std::string &prefix, parameterlist &params)
User* u = this->ServerInstance->FindNick(params[0]);
if (u)
{
+ if (item)
+ item->unserialize(FORMAT_NETWORK, u, params[2]);
FOREACH_MOD_I(this->ServerInstance,I_OnDecodeMetaData,OnDecodeMetaData(u,params[1],params[2]));
}
}
diff --git a/src/modules/m_sslinfo.cpp b/src/modules/m_sslinfo.cpp
index cca32d4da..cd636c633 100644
--- a/src/modules/m_sslinfo.cpp
+++ b/src/modules/m_sslinfo.cpp
@@ -123,20 +123,20 @@ class ModuleSSLInfo : public Module
Extensible::Register(&cmd.CertExt);
- Implementation eventlist[] = { I_OnSyncUser, I_OnDecodeMetaData, I_OnWhois, I_OnPreCommand };
- ServerInstance->Modules->Attach(eventlist, this, 4);
+ Implementation eventlist[] = { I_OnWhois, I_OnPreCommand };
+ ServerInstance->Modules->Attach(eventlist, this, 2);
}
- virtual ~ModuleSSLInfo()
+ ~ModuleSSLInfo()
{
}
- virtual Version GetVersion()
+ Version GetVersion()
{
return Version("SSL Certificate Utilities", VF_VENDOR);
}
- virtual void OnWhois(User* source, User* dest)
+ void OnWhois(User* source, User* dest)
{
if (cmd.CertExt.get(dest))
{
@@ -158,7 +158,7 @@ class ModuleSSLInfo : public Module
return false;
}
- virtual ModResult OnPreCommand(std::string &command, std::vector<std::string> &parameters, User *user, bool validated, const std::string &original_line)
+ ModResult OnPreCommand(std::string &command, std::vector<std::string> &parameters, User *user, bool validated, const std::string &original_line)
{
irc::string pcmd = command.c_str();