]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_alias.cpp
Resolve /STATS S conflict between SVSHOLD and SHUN
[user/henk/code/inspircd.git] / src / modules / m_alias.cpp
index 8a58e3dd4a18675ae37119556c56bb8bdf3f8004..33f877a57ede222beb1d6574cf74048dd7c55790 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
  * See: http://wiki.inspircd.org/Credits
  *
  * This program is free but copyrighted software; see
@@ -73,18 +73,17 @@ class ModuleAlias : public Module
                fprefix = fpre.empty() ? '!' : fpre[0];
 
                Aliases.clear();
-               for (int i = 0;; i++)
+               ConfigTagList tags = ServerInstance->Config->ConfTags("alias");
+               for(ConfigIter i = tags.first; i != tags.second; ++i)
                {
-                       ConfigTag* tag = ServerInstance->Config->ConfValue("alias", i);
-                       if (!tag)
-                               break;
+                       ConfigTag* tag = i->second;
                        Alias a;
                        a.AliasedCommand = tag->getString("text").c_str();
                        tag->readString("replace", a.ReplaceFormat, true);
                        a.RequiredNick = tag->getString("requires");
                        a.ULineOnly = tag->getBool("uline");
-                       a.ChannelCommand = tag->getBool("channelcommand", "no");
-                       a.UserCommand = tag->getBool("usercommand", "yes");
+                       a.ChannelCommand = tag->getBool("channelcommand", false);
+                       a.UserCommand = tag->getBool("usercommand", true);
                        a.OperOnly = tag->getBool("operonly");
                        a.format = tag->getString("format");
                        a.CaseSensitive = tag->getBool("matchcase");
@@ -136,7 +135,7 @@ class ModuleAlias : public Module
                return word;
        }
 
-       virtual ModResult OnPreCommand(std::string &command, std::vector<std::string> &parameters, User *user, bool validated, const std::string &original_line)
+       virtual ModResult OnPreCommand(std::string &command, std::vector<std::string> &parameters, LocalUser *user, bool validated, const std::string &original_line)
        {
                std::multimap<irc::string, Alias>::iterator i, upperbound;