]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_abbreviation.cpp
Make all User::IsModeSet() methods const, accept const ModeHandler
[user/henk/code/inspircd.git] / src / modules / m_abbreviation.cpp
index f69d26749727a7700fb4c5a08c00fbdb676d877b..85709080f8e1436c43ae1957d0b11c4366a8aee6 100644 (file)
@@ -42,13 +42,14 @@ class ModuleAbbreviation : public Module
                size_t clen = command.length() - 1;
                std::string foundcommand, matchlist;
                bool foundmatch = false;
-               for (Commandtable::iterator n = ServerInstance->Parser->cmdlist.begin(); n != ServerInstance->Parser->cmdlist.end(); ++n)
+               const CommandParser::CommandMap& commands = ServerInstance->Parser.GetCommands();
+               for (CommandParser::CommandMap::const_iterator n = commands.begin(); n != commands.end(); ++n)
                {
                        if (!command.compare(0, clen, n->first, 0, clen))
                        {
                                if (matchlist.length() > 450)
                                {
-                                       user->WriteNumeric(420, ":Ambiguous abbreviation and too many possible matches.");
+                                       user->WriteNumeric(420, "Ambiguous abbreviation and too many possible matches.");
                                        return MOD_RES_DENY;
                                }
 
@@ -66,7 +67,7 @@ class ModuleAbbreviation : public Module
                /* Ambiguous command, list the matches */
                if (!matchlist.empty())
                {
-                       user->WriteNumeric(420, ":Ambiguous abbreviation, posssible matches: %s%s", foundcommand.c_str(), matchlist.c_str());
+                       user->WriteNumeric(420, InspIRCd::Format("Ambiguous abbreviation, possible matches: %s%s", foundcommand.c_str(), matchlist.c_str()));
                        return MOD_RES_DENY;
                }