#include "modules.h"
#include "helperfuncs.h"
-Server *Srv;
-FileReader *quotes = NULL;
+static Server *Srv;
+static FileReader *quotes = NULL;
std::string q_file = "";
std::string prefix = "";
this->source = "m_randquote.so";
}
- void Handle (char** parameters, int pcntl, userrec *user)
+ void Handle (const char** parameters, int pcntl, userrec *user)
{
std::string str;
int fsize;
public:
RandquoteException(std::string message) : err(message) { }
- virtual char* GetReason()
+ virtual const char* GetReason()
{
return (char*)err.c_str();
}
-}
+};
class ModuleRandQuote : public Module
{
{
RandquoteException e("m_randquote: Quotefile not specified - Please check your config.");
throw(e);
- }
+ }
quotes = new FileReader(q_file);
if(!quotes->Exists())
virtual ~ModuleRandQuote()
{
- delete conf;
- delete quotes;
+ DELETE(conf);
+ DELETE(quotes);
}
virtual Version GetVersion()