aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Attila Molnar2016-11-16 11:58:03 +0100
committerGravatar GitHub2016-11-16 11:58:03 +0100
commit8189eb162eeef6a080bee90b6d6bac119ce4739c (patch)
tree7071721c75bcf9199a8ab93e5b9ac579355dc824 /src/modules
parentMerge pull request #1248 from SaberUK/master+listen (diff)
parentRework the example services aliases. (diff)
downloadinspircd++-8189eb162eeef6a080bee90b6d6bac119ce4739c.tar.gz
inspircd++-8189eb162eeef6a080bee90b6d6bac119ce4739c.tar.bz2
inspircd++-8189eb162eeef6a080bee90b6d6bac119ce4739c.zip
Merge pull request #1234 from SaberUK/master+config2
Rework the example services aliases.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_alias.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index 9184b10af..c6e53f0cf 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -271,7 +271,7 @@ class ModuleAlias : public Module
if (crlf == std::string::npos)
{
- DoCommand(a->ReplaceFormat, user, c, safe);
+ DoCommand(a->ReplaceFormat, user, c, safe, a);
return 1;
}
else
@@ -280,13 +280,13 @@ class ModuleAlias : public Module
std::string scommand;
while (commands.GetToken(scommand))
{
- DoCommand(scommand, user, c, safe);
+ DoCommand(scommand, user, c, safe, a);
}
return 1;
}
}
- void DoCommand(const std::string& newline, User* user, Channel *chan, const std::string &original_line)
+ void DoCommand(const std::string& newline, User* user, Channel *chan, const std::string &original_line, Alias* a)
{
std::string result;
result.reserve(newline.length());
@@ -328,6 +328,11 @@ class ModuleAlias : public Module
result.append(user->dhost);
i += 5;
}
+ else if (!newline.compare(i, 12, "$requirement", 12))
+ {
+ result.append(a->RequiredNick);
+ i += 11;
+ }
else
result.push_back(c);
}