1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 02:06:37 +02:00

Fixed db_sql etc being confused on empty vs not set metadata

This commit is contained in:
Adam
2013-01-26 20:52:49 -05:00
parent ed7c4dc2e1
commit 49cb6a07a2
+3 -2
View File
@@ -34,7 +34,7 @@ void Extensible::Extend(const Anope::string &key, ExtensibleItem *p)
void Extensible::ExtendMetadata(const Anope::string &key, const Anope::string &value)
{
this->Extend(key, new ExtensibleMetadata(value));
this->Extend(key, new ExtensibleMetadata(!value.empty() ? value : "1"));
}
bool Extensible::Shrink(const Anope::string &key)
@@ -93,7 +93,8 @@ void Extensible::ExtensibleUnserialize(Serialize::Data &data)
Anope::string str;
data[*it] >> str;
this->ExtendMetadata(it->substr(11), str);
if (!str.empty())
this->ExtendMetadata(it->substr(11), str);
}
}