]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chancreate.cpp
fixed some indentation and spacing in modules
[user/henk/code/inspircd.git] / src / modules / m_chancreate.cpp
index d2b0b4e45c1350a82c9ef3bbebf28dbcea0f243d..1b6ca61924381541401f34ac480398548f3fba80 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -23,29 +23,25 @@ class ModuleChanCreate : public Module
                : Module(Me)
        {
                ServerInstance->SNO->EnableSnomask('j', "CHANCREATE");
+               Implementation eventlist[] = { I_OnUserJoin };
+               ServerInstance->Modules->Attach(eventlist, this, 1);
        }
-       
+
        virtual ~ModuleChanCreate()
        {
                ServerInstance->SNO->DisableSnomask('j');
        }
-       
+
        virtual Version GetVersion()
        {
-               return Version(1,1,0,0,VF_VENDOR,API_VERSION);
+               return Version(1,2,0,0,VF_VENDOR,API_VERSION);
        }
 
-       void Implements(char* List)
-       {
-               List[I_OnUserJoin] = 1;
-       }
-       
-       virtual void OnUserJoin(User* user, Channel* channel, bool &silent)
+
+       virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent)
        {
                if (channel->GetUserCounter() == 1)
-               {
-                       ServerInstance->SNO->WriteToSnoMask('j', "Channel %s created by %s!%s@%s", channel->name, user->nick, user->ident, user->host);
-               }
+                       ServerInstance->SNO->WriteToSnoMask('j', "Channel %s created by %s!%s@%s", channel->name.c_str(), user->nick.c_str(), user->ident.c_str(), user->host.c_str());
        }
 };