#include "wildcard.h"
#include "mode.h"
#include "message.h"
+#include "commands.h"
// class type for holding an extended mode character - internal to core
void Module::OnPacketTransmit(char *p) { }
void Module::OnPacketReceive(char *p) { }
void Module::OnRehash() { }
-void Module::OnServerRaw(std::string &raw, bool inbound) { }
+void Module::OnServerRaw(std::string &raw, bool inbound, userrec* user) { }
int Module::OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) { return 0; }
bool Module::OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms) { return false; }
Version Module::GetVersion() { return Version(1,0,0,0); }
void Module::OnWhois(userrec* source, userrec* dest) { };
int Module::OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text) { return 0; };
int Module::OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text) { return 0; };
+int Module::OnUserPreNick(userrec* user, std::string newnick) { return 0; };
// server is a wrapper class that provides methods to all of the C-style
// exports in the core
kill_link(user,reason.c_str());
}
+bool Server::IsUlined(std::string server)
+{
+ return is_uline(server.c_str());
+}
+
void Server::CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user)
{
call_handler(commandname.c_str(),parameters,pcnt,user);
std::string ConfigReader::ReadValue(std::string tag, std::string name, int index)
{
char val[MAXBUF];
- ReadConf(cache,tag.c_str(),name.c_str(),index,val);
- return val;
+ char t[MAXBUF];
+ char n[MAXBUF];
+ strncpy(t,tag.c_str(),MAXBUF);
+ strncpy(n,name.c_str(),MAXBUF);
+ ReadConf(cache,t,n,index,val);
+ return std::string(val);
}