]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_alias.cpp
Automatically apply +P to all permanent channels.
[user/henk/code/inspircd.git] / src / modules / m_alias.cpp
index 9184b10af407ba83af17366e94a9db83a317ccb3..c6e53f0cfd71e3ca5219e104051caa476d780b46 100644 (file)
@@ -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);
                        }