]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules.cpp
Added xline.cpp and xline.h, implements k/g/z/q lines
[user/henk/code/inspircd.git] / src / modules.cpp
index 472c6ca9ebbf6ac2825d3ec866977cc83d61b383..7d81a9125ceb80ad67890637661faaf730c467b6 100644 (file)
 #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;
@@ -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);
 }