diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-14 13:30:43 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-01-14 13:30:43 +0000 |
commit | 0c828ad6d498a15f42b1d281ea979135a91b87e2 (patch) | |
tree | 96e8754700385a37ebef8bc3ef9d54302d672645 /src/modules | |
parent | b3685095cd00ac6204ed17161a635888905c16d6 (diff) |
Add alias:matchcase config setting (per-alias, determines wether to match case on format string) and ability for case sensitive match()
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6319 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_alias.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index ffa6c1e46..e8fe736c4 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -15,6 +15,7 @@ #include "channels.h" #include "modules.h" #include "inspircd.h" +#include "wildcard.h" #include <vector> /* $ModDesc: Provides aliases of commands. */ @@ -34,6 +35,8 @@ class Alias : public classbase bool uline; /** Requires oper? */ bool operonly; + /* is case sensitive params */ + bool case_sensitive; /** Format that must be matched for use */ std::string format; }; @@ -63,6 +66,7 @@ class ModuleAlias : public Module a.uline = MyConf.ReadFlag("alias", "uline", i); a.operonly = MyConf.ReadFlag("alias", "operonly", i); a.format = MyConf.ReadValue("alias", "format", i); + a.case_sensitive = MyConf.ReadFlag("alias", "matchcase", i); Aliases.push_back(a); AliasMap[txt] = 1; } @@ -162,9 +166,10 @@ class ModuleAlias : public Module if (Aliases[i].text == c) { /* Does it match the pattern? */ - if ((!Aliases[i].format.empty()) && (!ServerInstance->MatchText(compare, Aliases[i].format))) + if (!Aliases[i].format.empty()) { - continue; + if (!match(Aliases[i].case_sensitive, compare.c_str(), Aliases[i].format.c_str())) + continue; } if ((Aliases[i].operonly) && (!*user->oper)) |