]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_knock.cpp
Added ability to update the helpop file on rehash (Bug #69)
[user/henk/code/inspircd.git] / src / modules / m_knock.cpp
index 3096423c4045bbae62576ba7b5e19c841b4a124d..171e7045aa3ff051462375c694279c26bc471c48 100644 (file)
  * ---------------------------------------------------
  */
 
+using namespace std;
+
 #include <stdio.h>
 #include <string>
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
+#include "helperfuncs.h"
 
 /* $ModDesc: Provides support for /KNOCK and mode +K */
 
@@ -40,9 +43,9 @@ void handle_knock(char **parameters, int pcnt, userrec *user)
                WriteServ(user->fd,"480 %s :Can't KNOCK on %s, +K is set.",user->nick, c->name);
                return;
        }
-       if (c->inviteonly)
+       if (c->binarymodes & CM_INVITEONLY)
        {
-               WriteChannelWithServ((char*)Srv->GetServerName().c_str(),c,user,"NOTICE %s :User %s is KNOCKing on %s (%s)",c->name,user->nick,c->name,line.c_str());
+               WriteChannelWithServ((char*)Srv->GetServerName().c_str(),c,"NOTICE %s :User %s is KNOCKing on %s (%s)",c->name,user->nick,c->name,line.c_str());
                WriteServ(user->fd,"NOTICE %s :KNOCKing on %s",user->nick,c->name);
                return;
        }
@@ -94,7 +97,7 @@ class ModuleKnock : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,1,VF_STATIC);
+               return Version(1,0,0,1,VF_STATIC|VF_VENDOR);
        }
        
        virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params)