* | 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
*/
#include "inspircd.h"
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
#include "wildcard.h"
/* $ModDesc: Sets (and unsets) modes on users when they connect */
{
Conf = new ConfigReader(ServerInstance);
+ Implementation eventlist[] = { I_OnPostConnect, I_OnRehash };
+ ServerInstance->Modules->Attach(eventlist, this, 2);
}
- void Implements(char* List)
- {
- List[I_OnPostConnect] = List[I_OnRehash] = 1;
- }
- virtual void OnRehash(userrec* user, const std::string ¶meter)
+ virtual void OnRehash(User* user, const std::string ¶meter)
{
- DELETE(Conf);
+ delete Conf;
Conf = new ConfigReader(ServerInstance);
}
virtual ~ModuleModesOnConnect()
{
- DELETE(Conf);
+ delete Conf;
}
virtual Version GetVersion()
{
- return Version(1,1,0,1,VF_VENDOR,API_VERSION);
+ return Version(1,2,0,1,VF_VENDOR,API_VERSION);
}
- virtual void OnPostConnect(userrec* user)
+ virtual void OnPostConnect(User* user)
{
if (!IS_LOCAL(user))
return;
if (!ThisModes.empty())
{
std::string buf;
- stringstream ss(ThisModes);
+ std::stringstream ss(ThisModes);
- vector<string> tokens;
+ std::vector<std::string> tokens;
// split ThisUserModes into modes and mode params
while (ss >> buf)
}
};
-MODULE_INIT(ModuleModesOnConnect);
+MODULE_INIT(ModuleModesOnConnect)