]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules.cpp
Move nick change code out of cmd_nick; fixes double-invocation of hooks and may elimi...
[user/henk/code/inspircd.git] / src / modules.cpp
index fab9e2955a50fa7d76c62e06580e92ba8aad2236..58c27e4902d236f26d294899bd057eb500e4d6e6 100644 (file)
@@ -175,7 +175,7 @@ ModuleManager::~ModuleManager()
 bool ModuleManager::Attach(Implementation i, Module* mod)
 {
        if (Modules.find(mod->ModuleSourceFile) == Modules.end())
-               ServerInstance->Logs->Log("MODULE", ERROR, "Module %s is attaching to hook %d in constructor; this does not handle exceptions correctly!", mod->ModuleSourceFile.c_str(), i);
+               ServerInstance->Logs->Log("MODULE", DEFAULT, "Module is attaching to hook %d in constructor; this does not handle exceptions correctly!", i);
 
        if (std::find(EventHandlers[i].begin(), EventHandlers[i].end(), mod) != EventHandlers[i].end())
                return false;
@@ -424,7 +424,7 @@ void ModuleManager::AddService(ServiceProvider& item)
 {
        Module* owner = item.creator;
        if (Modules.find(owner->ModuleSourceFile) == Modules.end())
-               ServerInstance->Logs->Log("MODULE", ERROR, "Module %s is registering item %s in constructor; this does not handle exceptions correctly!", owner->ModuleSourceFile.c_str(), item.name.c_str());
+               ServerInstance->Logs->Log("MODULE", DEFAULT, "Module is registering item %s in constructor; this does not handle exceptions correctly!", item.name.c_str());
 
        switch (item.service)
        {
@@ -524,6 +524,14 @@ void InspIRCd::SendMode(const std::vector<std::string>& parameters, User *user)
        this->Modes->Process(parameters, user);
 }
 
+
+void InspIRCd::SendGlobalMode(const std::vector<std::string>& parameters, User *user)
+{
+       Modes->Process(parameters, user);
+       if (!Modes->GetLastParse().empty())
+               this->PI->SendMode(parameters[0], Modes->GetLastParseParams(), Modes->GetLastParseTranslate());
+}
+
 bool InspIRCd::AddResolver(Resolver* r, bool cached)
 {
        if (!cached)
@@ -558,6 +566,8 @@ const std::vector<std::string> ModuleManager::GetAllModuleNames(int filter)
 ConfigReader::ConfigReader()
 {
        this->error = 0;
+       ServerInstance->Logs->Log("MODULE", DEBUG, "ConfigReader is deprecated in 2.0; "
+               "use ServerInstance->Config->ConfValue(\"key\") or ->ConfTags(\"key\") instead");
 }