]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_svshold.cpp
A few more I missed.
[user/henk/code/inspircd.git] / src / modules / m_svshold.cpp
index 25df81f7b1aac4121c6b97a39b5d53d3425774ba..4058c04d07312c9b752eccca37e2667f62fccc80 100644 (file)
@@ -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)