diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-08-21 20:56:16 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-08-21 20:56:16 +0000 |
commit | c16cda5d715241bb4bff8050bee942a8a34a72c0 (patch) | |
tree | 145095fad6904382ecf6775dedc5c981d406a61a /src/commands | |
parent | 5e3bfa266bd99ac15fd621c6e14d12787ba22f6e (diff) |
match() is no longer a function+no header, now a static method of InspIRCd class, blah blah blah. Also rip out the 1.2 matcher, as it was slow, and replace it with one adapted from znc, which happens to be a tiny bit faster than 1.1's (and the fastest I've seen so far that works properly)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10212 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_list.cpp | 3 | ||||
-rw-r--r-- | src/commands/cmd_modules.cpp | 1 | ||||
-rw-r--r-- | src/commands/cmd_notice.cpp | 3 | ||||
-rw-r--r-- | src/commands/cmd_oper.cpp | 3 | ||||
-rw-r--r-- | src/commands/cmd_privmsg.cpp | 3 | ||||
-rw-r--r-- | src/commands/cmd_rehash.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_who.cpp | 11 |
7 files changed, 10 insertions, 16 deletions
diff --git a/src/commands/cmd_list.cpp b/src/commands/cmd_list.cpp index b2ec1941b..d4abfd437 100644 --- a/src/commands/cmd_list.cpp +++ b/src/commands/cmd_list.cpp @@ -13,7 +13,6 @@ #include "inspircd.h" #include "commands/cmd_list.h" -#include "wildcard.h" /** Handle /LIST */ @@ -54,7 +53,7 @@ CmdResult CommandList::Handle (const std::vector<std::string>& parameters, User if (parameters.size() && (parameters[0][0] != '<' || parameters[0][0] == '>')) { - if (!match(i->second->name, parameters[0]) && !match(i->second->topic, parameters[0])) + if (!InspIRCd::Match(i->second->name, parameters[0], lowermap) && !InspIRCd::Match(i->second->topic, parameters[0], lowermap)) continue; } diff --git a/src/commands/cmd_modules.cpp b/src/commands/cmd_modules.cpp index 9474dece4..0b7ce2577 100644 --- a/src/commands/cmd_modules.cpp +++ b/src/commands/cmd_modules.cpp @@ -12,7 +12,6 @@ */ #include "inspircd.h" -#include "wildcard.h" #include "commands/cmd_modules.h" const char* itab[] = { diff --git a/src/commands/cmd_notice.cpp b/src/commands/cmd_notice.cpp index 9cf4800a4..37f11eeb9 100644 --- a/src/commands/cmd_notice.cpp +++ b/src/commands/cmd_notice.cpp @@ -12,7 +12,6 @@ */ #include "inspircd.h" -#include "wildcard.h" #include "commands/cmd_notice.h" extern "C" DllExport Command* init_command(InspIRCd* Instance) @@ -42,7 +41,7 @@ CmdResult CommandNotice::Handle (const std::vector<std::string>& parameters, Use const char* servermask = (parameters[0].c_str()) + 1; FOREACH_MOD(I_OnText,OnText(user, (void*)parameters[0].c_str(), TYPE_SERVER, text, 0, exempt_list)); - if (match(ServerInstance->Config->ServerName,servermask)) + if (InspIRCd::Match(ServerInstance->Config->ServerName,servermask, NULL)) { user->SendAll("NOTICE", "%s", text); } diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index 97134f038..8522890e0 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -12,7 +12,6 @@ */ #include "inspircd.h" -#include "wildcard.h" #include "commands/cmd_oper.h" #include "hashcomp.h" @@ -22,7 +21,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist) std::string xhost; while (hl >> xhost) { - if (match(host, xhost) || match(ip,xhost, true)) + if (InspIRCd::MatchCIDR(host, xhost, NULL) || InspIRCd::MatchCIDR(ip, xhost, NULL)) { return true; } diff --git a/src/commands/cmd_privmsg.cpp b/src/commands/cmd_privmsg.cpp index 0086bb72d..135ab809e 100644 --- a/src/commands/cmd_privmsg.cpp +++ b/src/commands/cmd_privmsg.cpp @@ -12,7 +12,6 @@ */ #include "inspircd.h" -#include "wildcard.h" #include "commands/cmd_privmsg.h" extern "C" DllExport Command* init_command(InspIRCd* Instance) @@ -43,7 +42,7 @@ CmdResult CommandPrivmsg::Handle (const std::vector<std::string>& parameters, Us const char* servermask = (parameters[0].c_str()) + 1; FOREACH_MOD(I_OnText,OnText(user, (void*)parameters[0].c_str(), TYPE_SERVER, text, 0, except_list)); - if (match(ServerInstance->Config->ServerName,servermask)) + if (InspIRCd::Match(ServerInstance->Config->ServerName, servermask, NULL)) { user->SendAll("PRIVMSG", "%s", text); } diff --git a/src/commands/cmd_rehash.cpp b/src/commands/cmd_rehash.cpp index cab593457..28ae32a0d 100644 --- a/src/commands/cmd_rehash.cpp +++ b/src/commands/cmd_rehash.cpp @@ -28,7 +28,7 @@ CmdResult CommandRehash::Handle (const std::vector<std::string>& parameters, Use if (parameters.size() && parameters[0][0] != '-') { - if (!ServerInstance->MatchText(ServerInstance->Config->ServerName, parameters[0])) + if (!InspIRCd::Match(ServerInstance->Config->ServerName, parameters[0], lowermap)) { FOREACH_MOD(I_OnRehash,OnRehash(user, parameters[0])); return CMD_SUCCESS; // rehash for a server, and not for us diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index a9f27de83..845670acf 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -12,7 +12,6 @@ */ #include "inspircd.h" -#include "wildcard.h" #include "commands/cmd_who.h" static const std::string star = "*"; @@ -75,15 +74,15 @@ bool CommandWho::whomatch(User* user, const char* matchtext) else { if (opt_realname) - realname = match(user->fullname, matchtext); + realname = InspIRCd::Match(user->fullname, matchtext, lowermap); else { if (opt_showrealhost) - realhost = match(user->host, matchtext); + realhost = InspIRCd::Match(user->host, matchtext, lowermap); else { if (opt_ident) - ident = match(user->ident, matchtext); + ident = InspIRCd::Match(user->ident, matchtext, lowermap); else { if (opt_port) @@ -97,13 +96,13 @@ bool CommandWho::whomatch(User* user, const char* matchtext) else { if (opt_away) - away = match(user->awaymsg, matchtext); + away = InspIRCd::Match(user->awaymsg, matchtext, lowermap); } } } } } - return ((port) || (away) || (ident) || (metadata) || (realname) || (realhost) || (match(user->dhost, matchtext)) || (match(user->nick, matchtext)) || (match(user->server, matchtext))); + return ((port) || (away) || (ident) || (metadata) || (realname) || (realhost) || (InspIRCd::Match(user->dhost, matchtext, lowermap)) || (InspIRCd::Match(user->nick, matchtext, lowermap)) || (InspIRCd::Match(user->server, matchtext, lowermap))); } } |