summaryrefslogtreecommitdiff
path: root/src/modules/m_callerid.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-13 20:32:03 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-13 20:32:03 +0000
commit0ed3ef9dee2cb8f4b0c37da218a2fd1eee8c31f6 (patch)
tree933fa0ba26a0113b0404ca52796440bc297a614c /src/modules/m_callerid.cpp
parentd9e3bb8d4343643504ab7ee6ab943a000065cc8a (diff)
Add SerializeFormat for easier metadata formatting
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11704 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_callerid.cpp')
-rw-r--r--src/modules/m_callerid.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index b84ee2c9c..dab0d3d43 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -56,14 +56,15 @@ class callerid_data : public classbase
}
}
- std::string ToString(Module* proto) const
+ std::string ToString(SerializeFormat format) const
{
std::ostringstream oss;
oss << lastnotify;
for (std::set<User*>::const_iterator i = accepting.begin(); i != accepting.end(); ++i)
{
+ User* u = *i;
// Encode UIDs.
- oss << "," << proto->ProtoTranslate(*i);
+ oss << "," << (format == FORMAT_USER ? u->nick : u->uuid);
}
oss << std::ends;
return oss.str();
@@ -77,13 +78,13 @@ struct CallerIDExtInfo : public ExtensionItem
{
}
- std::string serialize(Module* requestor, const Extensible* container, void* item)
+ std::string serialize(SerializeFormat format, const Extensible* container, void* item)
{
callerid_data* dat = static_cast<callerid_data*>(item);
- return dat->ToString(requestor);
+ return dat->ToString(format);
}
- void unserialize(Module* requestor, Extensible* container, const std::string& value)
+ void unserialize(SerializeFormat format, Extensible* container, const std::string& value)
{
callerid_data* dat = new callerid_data(value);
set_raw(container, dat);