/* $ModDesc: Provides aliases of commands. */
-class Alias
+class Alias : public classbase
{
public:
irc::string text;
virtual ~ModuleAlias()
{
- delete MyConf;
+ DELETE(MyConf);
}
virtual Version GetVersion()
return Version(1,0,0,1,VF_VENDOR);
}
- virtual int OnPreCommand(const std::string &command, char **parameters, int pcnt, userrec *user, bool validated)
+ virtual int OnPreCommand(const std::string &command, const char** parameters, int pcnt, userrec *user, bool validated)
{
userrec *u = NULL;
irc::string c = command.c_str();
* and if theyre not registered yet, we dont want
* to know either
*/
- if ((validated) || (user->registered != 7))
+ if ((validated) || (user->registered != REG_ALL))
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))
{
stuff >> cmd;
stuff >> target;
- char* para[2];
- para[0] = (char*)target.c_str();
- para[1] = (char*)n.c_str();
+ const char* para[2];
+ para[0] = target.c_str();
+ para[1] = n.c_str();
Srv->CallCommandHandler(cmd,para,2,user);
return 1;
virtual void OnRehash(const std::string ¶meter)
{
- delete MyConf;
+ DELETE(MyConf);
MyConf = new ConfigReader;
ReadAliases();