]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_channelban.cpp
Attach to events and register services in init()
[user/henk/code/inspircd.git] / src / modules / m_channelban.cpp
index 655ed82cd9e1c5a842685de0e1bf5f2e274e7024..71d4de784afefefbb379a1ec962907c74542f5b7 100644 (file)
@@ -26,7 +26,8 @@ class ModuleBadChannelExtban : public Module
 {
  private:
  public:
-       ModuleBadChannelExtban()        {
+       void init()
+       {
                Implementation eventlist[] = { I_OnCheckBan, I_On005Numeric };
                ServerInstance->Modules->Attach(eventlist, this, 2);
        }
@@ -42,7 +43,7 @@ class ModuleBadChannelExtban : public Module
 
        ModResult OnCheckBan(User *user, Channel *c, const std::string& mask)
        {
-               if (mask[0] == 'j' && mask[1] == ':')
+               if ((mask.length() > 2) && (mask[0] == 'j') && (mask[1] == ':'))
                {
                        std::string rm = mask.substr(2);
                        char status = 0;