* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
class QueryInfo
{
+private:
+ InspIRCd* ServerInstance;
public:
QueryState qs;
unsigned long id;
time_t date;
bool insert;
- QueryInfo(const std::string &n, const std::string &s, const std::string &h, unsigned long i, int cat)
+ QueryInfo(InspIRCd* Instance, const std::string &n, const std::string &s, const std::string &h, unsigned long i, int cat)
{
+ ServerInstance = Instance;
qs = FIND_SOURCE;
nick = n;
source = s;
id = i;
category = cat;
sourceid = nickid = hostid = -1;
- date = time(NULL);
+ date = ServerInstance->Time();
insert = false;
}
SQLModule = ServerInstance->Modules->FindFeature("SQL");
- OnRehash(NULL,"");
+ OnRehash(NULL);
MyMod = this;
active_queries.clear();
dbid = Conf.ReadValue("sqllog","dbid",0); // database id of a database configured in sql module
}
- virtual void OnRehash(User* user, const std::string ¶meter)
+ virtual void OnRehash(User* user)
{
ReadConfig();
}
SQLrequest req = SQLrequest(this, SQLModule, dbid, SQLquery("SELECT id,actor FROM ircd_log_actors WHERE actor='?'") % source);
if(req.Send())
{
- QueryInfo* i = new QueryInfo(nick, source, host, req.id, category);
+ QueryInfo* i = new QueryInfo(ServerInstance, nick, source, host, req.id, category);
i->qs = FIND_SOURCE;
active_queries[req.id] = i;
}
AddLogEntry(LT_OPER,user->nick,user->host,user->server);
}
- virtual int OnKill(User* source, User* dest, const std::string &reason)
+ virtual ModResult OnKill(User* source, User* dest, const std::string &reason)
{
AddLogEntry(LT_KILL,dest->nick,dest->host,source->nick);
- return 0;
+ return MOD_RES_PASSTHRU;
}
- virtual int OnPreCommand(std::string &command, std::vector<std::string> ¶meters, User *user, bool validated, const std::string &original_line)
+ virtual ModResult OnPreCommand(std::string &command, std::vector<std::string> ¶meters, User *user, bool validated, const std::string &original_line)
{
if ((command == "GLINE" || command == "KLINE" || command == "ELINE" || command == "ZLINE") && validated)
{
AddLogEntry(LT_XLINE,user->nick,command[0]+std::string(":")+parameters[0],user->server);
}
- return 0;
+ return MOD_RES_PASSTHRU;
}
virtual void OnUserConnect(User* user)
virtual Version GetVersion()
{
- return Version("$Id$", VF_VENDOR, API_VERSION);
+ return Version("Logs network-wide data to an SQL database", VF_VENDOR, API_VERSION);
}
};