X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules.cpp;h=d2f01297781c3ef270e9262ece46abd3e7dff679;hb=deb5dd0dd3b9aeacc544080569c57dacb6cad9de;hp=472c6ca9ebbf6ac2825d3ec866977cc83d61b383;hpb=642b665fb0967dc9dcbaed5f54b52276ea230e12;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules.cpp b/src/modules.cpp index 472c6ca9e..d2f012977 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -12,10 +12,13 @@ #include "ctables.h" #include "inspircd_io.h" #include "wildcard.h" +#include "mode.h" +#include "message.h" +#include "commands.h" // class type for holding an extended mode character - internal to core -class ExtMode +class ExtMode : public classbase { public: char modechar; @@ -114,7 +117,7 @@ void Module::OnUserPart(userrec* user, chanrec* channel) { } 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); } @@ -123,6 +126,7 @@ void Module::OnInfo(userrec* user) { }; 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 @@ -175,6 +179,11 @@ void Server::QuitUser(userrec* user, std::string reason) 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); @@ -354,8 +363,12 @@ ConfigReader::ConfigReader(std::string filename) 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); }