* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
* E-mail:
* <brain@chatspike.net>
* <Craig@chatspike.net>
MyConf = new ConfigReader;
ReadAliases();
}
+
+ void Implements(char* List)
+ {
+ List[I_OnPreCommand] = List[I_OnRehash] = 1;
+ }
virtual ~ModuleAlias()
{
- delete MyConf;
+ DELETE(MyConf);
}
virtual Version GetVersion()
return Version(1,0,0,1,VF_VENDOR);
}
- virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
{
userrec *u = NULL;
irc::string c = command.c_str();
- /* If the command is valid, we dont want to know */
- if (validated)
+ /* If the command is valid, we dont want to know,
+ * and if theyre not registered yet, we dont want
+ * to know either
+ */
+ if ((validated) || (user->registered != 7))
return 0;
for (unsigned int i = 0; i < Aliases.size(); i++)
return 1;
}
}
- if (Aliases[i].uline)
+ if ((u != NULL) && (Aliases[i].requires != "") && (Aliases[i].uline))
{
if (!Srv->IsUlined(u->server))
{
return 0;
}
- virtual void OnRehash(std::string parameter)
+ virtual void OnRehash(const std::string ¶meter)
{
- delete MyConf;
+ DELETE(MyConf);
MyConf = new ConfigReader;
ReadAliases();