]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_xmlsocket.cpp
Whoops, schoolboy error
[user/henk/code/inspircd.git] / src / modules / m_xmlsocket.cpp
index 2973ed187c2e8de0c9b1f5adfcf99f4ae159e3ae..a60512d307193c365b4ad4ab6cb5fff3afdb4a6d 100644 (file)
@@ -102,22 +102,22 @@ class ModuleXMLSocket : public Module
                if(target_type == TYPE_USER)
                {
                        User* user = (User*)item;
-                       if(user->io == this)
-                               user->io = NULL;
+                       if(user->GetIOHook() == this)
+                               user->DelIOHook();
                }
        }
 
        virtual Version GetVersion()
        {
-               return Version(1, 2, 0, 0, VF_VENDOR, API_VERSION);
+               return Version("$Id$", VF_VENDOR, API_VERSION);
        }
 
        virtual void OnHookUserIO(User* user, const std::string &targetip)
        {
-               if (!user->io && isin(targetip,user->GetPort(),listenports))
+               if (!user->GetIOHook() && isin(targetip,user->GetPort(),listenports))
                {
                        /* Hook the user with our module */
-                       user->io = this;
+                       user->AddIOHook(this);
                }
        }
 
@@ -170,10 +170,7 @@ class ModuleXMLSocket : public Module
                        if ((tmpbuffer[n] == '\r') || (tmpbuffer[n] == '\n'))
                                tmpbuffer[n] = 0;
 
-               std::string buf(tmpbuffer, count);
-               LineBuffer *l = new LineBuffer(buf);
-               l->SetRefcount(1);
-               user->AddWriteBuf(l);
+               user->AddWriteBuf(std::string(tmpbuffer,count));
                delete [] tmpbuffer;
 
                return 1;