diff options
| author | 2019-09-23 00:37:33 +0100 | |
|---|---|---|
| committer | 2019-09-23 00:37:33 +0100 | |
| commit | 8848169e8b42b5ed85837efd3b3f9e36ffbada1b (patch) | |
| tree | 04babb46ea381f254589b12288f121d53338cb67 /src/modules/m_alias.cpp | |
| parent | Install libc++abi-dev on Travis. (diff) | |
| parent | Lower the acceptable drift for clocks on link. (diff) | |
Merge branch 'insp3' into master.
Diffstat (limited to 'src/modules/m_alias.cpp')
| -rw-r--r-- | src/modules/m_alias.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 1904af549..e3308b027 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -50,6 +50,9 @@ class Alias /** Format that must be matched for use */ std::string format; + + /** Strip color codes before match? */ + bool StripColor; }; class ModuleAlias : public Module @@ -94,6 +97,7 @@ class ModuleAlias : public Module a.UserCommand = tag->getBool("usercommand", true); a.OperOnly = tag->getBool("operonly"); a.format = tag->getString("format"); + a.StripColor = tag->getBool("stripcolor"); std::transform(a.AliasedCommand.begin(), a.AliasedCommand.end(), a.AliasedCommand.begin(), ::toupper); newAliases.insert(std::make_pair(a.AliasedCommand, a)); @@ -261,10 +265,14 @@ class ModuleAlias : public Module int DoAlias(User *user, Channel *c, Alias *a, const std::string& compare, const std::string& safe) { + std::string stripped(compare); + if (a->StripColor) + InspIRCd::StripColor(stripped); + /* Does it match the pattern? */ if (!a->format.empty()) { - if (!InspIRCd::Match(compare, a->format)) + if (!InspIRCd::Match(stripped, a->format)) return 0; } |
