X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_svshold.cpp;h=4058c04d07312c9b752eccca37e2667f62fccc80;hb=d556a4f8740b65e635ff7d2b976faaedbdac51d4;hp=25df81f7b1aac4121c6b97a39b5d53d3425774ba;hpb=71b9ae263d434609b96dfe2eaf7a4945c87587fb;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index 25df81f7b..4058c04d0 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -238,19 +238,21 @@ class ModuleSVSHold : public Module std::string EncodeSVSHold(const SVSHold* ban) { std::ostringstream stream; - stream << ban->nickname << " " << ban->set_by << " " << ban->set_on << " " << ban->length << " " << ban->reason; + stream << ban->nickname << " " << ban->set_by << " " << ban->set_on << " " << ban->length << " :" << ban->reason; return stream.str(); } SVSHold* DecodeSVSHold(const std::string &data) { SVSHold* res = new SVSHold(); - std::istringstream stream(data); - stream >> res->nickname; - stream >> res->set_by; - stream >> res->set_on; - stream >> res->length; - res->reason = stream.str(); + int set_on; + irc::tokenstream tokens(data); + tokens.GetToken(res->nickname); + tokens.GetToken(res->set_by); + tokens.GetToken(set_on); + res->set_on = set_on; + tokens.GetToken(res->length); + tokens.GetToken(res->reason); return res; } @@ -277,26 +279,4 @@ class ModuleSVSHold : public Module } }; -class ModuleSVSHoldFactory : public ModuleFactory -{ - public: - ModuleSVSHoldFactory() - { - } - - ~ModuleSVSHoldFactory() - { - } - - virtual Module * CreateModule(InspIRCd* Me) - { - return new ModuleSVSHold(Me); - } - -}; - - -extern "C" DllExport void * init_module( void ) -{ - return new ModuleSVSHoldFactory; -} +MODULE_INIT(ModuleSVSHold)