]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/command_parse.cpp
Use 'c' snomask instead of 'A' snomask for ldap auth failures, reported by drich.
[user/henk/code/inspircd.git] / src / command_parse.cpp
index d0b1148165815f494225d1dcff3986643876f7d6..409444e0c3db3493b6e397f4b44e5738e0341247 100644 (file)
@@ -3,7 +3,7 @@
  *       +------------------------------------+
  *
  *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
  *         the file COPYING for details.
@@ -374,7 +374,7 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd)
                                                                                user->nick.c_str(), command.c_str());
                }
 
-               ServerInstance->SNO->WriteToSnoMask('d', "%s denied for %s (%s@%s)",
+               ServerInstance->SNO->WriteToSnoMask('t', "%s denied for %s (%s@%s)",
                                command.c_str(), user->nick.c_str(), user->ident.c_str(), user->host.c_str());
                return do_more;
        }
@@ -506,23 +506,20 @@ bool CommandParser::ReloadCommand(std::string cmd, User* user)
                cmdlist.erase(cmdlist.find(cmd));
 
                RFCCommands.erase(cmd);
-               std::transform(cmd.begin(), cmd.end(), cmd.begin(), ::tolower);
                delete cmdptr;
                dlclose(command->second);
-
-               snprintf(filename, MAXBUF, "cmd_%s.so", cmd.c_str());
-               const char* err = this->LoadCommand(filename);
-               if (err)
-               {
-                       if (user)
-                               user->WriteServ("NOTICE %s :*** Error loading 'cmd_%s.so': %s", user->nick.c_str(), cmd.c_str(), err);
-                       return false;
-               }
-
-               return true;
        }
 
-       return false;
+       std::transform(cmd.begin(), cmd.end(), cmd.begin(), ::tolower);
+       snprintf(filename, MAXBUF, "cmd_%s.so", cmd.c_str());
+       const char* err = this->LoadCommand(filename);
+       if (err)
+       {
+               if (user)
+                       user->WriteServ("NOTICE %s :*** Error loading '%s': %s", user->nick.c_str(), filename, err);
+               return false;
+       }
+       return true;
 }
 
 CmdResult CommandReload::Handle(const std::vector<std::string>& parameters, User *user)
@@ -539,7 +536,7 @@ CmdResult CommandReload::Handle(const std::vector<std::string>& parameters, User
        }
        else
        {
-               user->WriteServ("NOTICE %s :*** Could not reload command '%s' -- fix this problem, then /REHASH as soon as possible!", user->nick.c_str(), parameters[0].c_str());
+               user->WriteServ("NOTICE %s :*** Could not reload command '%s'. The command will not work until reloaded successfully.", user->nick.c_str(), parameters[0].c_str());
                return CMD_FAILURE;
        }
 }
@@ -609,19 +606,20 @@ void CommandParser::SetupCommandTable()
                this->CreateCommand(new CommandReload(ServerInstance));
 }
 
-int CommandParser::TranslateUIDs(const std::vector<TranslateType> to, const std::string &source, std::string &dest)
+int CommandParser::TranslateUIDs(const std::deque<TranslateType> to, const std::deque<std::string> &source, std::string &dest)
 {
-       irc::spacesepstream items(source);
-       std::vector<TranslateType>::const_iterator types = to.begin();
+       std::deque<std::string>::const_iterator items = source.begin();
+       std::deque<TranslateType>::const_iterator types = to.begin();
        User* user = NULL;
-       std::string item;
        int translations = 0;
        dest.clear();
 
-       while (items.GetToken(item))
+       while (items != source.end() && types != to.end())
        {
                TranslateType t = *types;
+               std::string item = *items;
                types++;
+               items++;
 
                switch (t)
                {