From 0b44d28a3143c7f6925a5d3956d9e982974a46de Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 23 Jan 2009 13:40:24 +0000 Subject: Templateise this git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10991 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_alias.cpp | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'src/modules/m_alias.cpp') diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index 76aceffc9..160e3cea3 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -155,17 +155,11 @@ class ModuleAlias : public Module while (*(compare.c_str()) == ' ') compare.erase(compare.begin()); - std::string safe(original_line); - - /* Escape out any $ symbols in the user provided text */ - - SearchAndReplace(safe, "$", "\r"); - while (i != upperbound) { if (i->second.UserCommand) { - if (DoAlias(user, NULL, &(i->second), compare, safe)) + if (DoAlias(user, NULL, &(i->second), compare, original_line)) { return 1; } @@ -237,9 +231,6 @@ class ModuleAlias : public Module std::string safe(compare); - /* Escape out any $ symbols in the user provided text (ugly, but better than crashy) */ - SearchAndReplace(safe, "$", "\r"); - ServerInstance->Logs->Log("FANTASY", DEBUG, "fantasy: compare is %s and safe is %s", compare.c_str(), safe.c_str()); while (i != upperbound) @@ -350,20 +341,17 @@ class ModuleAlias : public Module } /* Special variables */ - SearchAndReplace(newline, "$nick", user->nick); - SearchAndReplace(newline, "$ident", user->ident); - SearchAndReplace(newline, "$host", user->host); - SearchAndReplace(newline, "$vhost", user->dhost); + SearchAndReplace(newline, std::string("$nick"), user->nick); + SearchAndReplace(newline, std::string("$ident"), user->ident); + SearchAndReplace(newline, std::string("$host"), user->host); + SearchAndReplace(newline, std::string("$vhost"), user->dhost); if (c) { /* Channel specific variables */ - SearchAndReplace(newline, "$chan", c->name); + SearchAndReplace(newline, std::string("$chan"), c->name); } - /* Unescape any variable names in the user text before sending */ - SearchAndReplace(newline, "\r", "$"); - irc::tokenstream ss(newline); pars.clear(); std::string command, token; -- cgit v1.3.1-10-gc9f91