mirror of
https://github.com/anope/anope.git
synced 2026-07-05 06:33:13 +02:00
Patch from DP, converting all match calls and removing old match method.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2111 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -627,9 +627,6 @@ E char *strnrepl(char *s, int32 size, const char *old, const char *nstr);
|
||||
E const char *merge_args(int argc, char **argv);
|
||||
E const char *merge_args(int argc, const char **argv);
|
||||
|
||||
// Use Anope::Match() instead of these.
|
||||
E int match_wild(const char *pattern, const char *str) MARK_DEPRECATED;
|
||||
E int match_wild_nocase(const char *pattern, const char *str) MARK_DEPRECATED;
|
||||
E time_t dotime(const char *s);
|
||||
E const char *duration(NickCore *nc, char *buf, int bufsize, time_t seconds);
|
||||
E const char *expire_left(NickCore *nc, char *buf, int len, time_t expires);
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ void sqline(char *mask, char *reason)
|
||||
for (c = chanlist[i]; c; c = next) {
|
||||
next = c->next;
|
||||
|
||||
if (!match_wild_nocase(mask, c->name)) {
|
||||
if (!Anope::Match(c->name, mask, false)) {
|
||||
continue;
|
||||
}
|
||||
for (cu = c->users; cu; cu = cunext) {
|
||||
|
||||
+3
-3
@@ -2156,13 +2156,13 @@ int entry_match(Entry * e, const char *nick, const char *user, const char *host,
|
||||
&& (!user || stricmp(e->host, host) != 0))
|
||||
return 0;
|
||||
if ((e->type & ENTRYTYPE_NICK_WILD)
|
||||
&& !match_wild_nocase(e->nick, nick))
|
||||
&& !Anope::Match(nick, e->nick, false))
|
||||
return 0;
|
||||
if ((e->type & ENTRYTYPE_USER_WILD)
|
||||
&& !match_wild_nocase(e->user, user))
|
||||
&& !Anope::Match(user, e->user, false))
|
||||
return 0;
|
||||
if ((e->type & ENTRYTYPE_HOST_WILD)
|
||||
&& !match_wild_nocase(e->host, host))
|
||||
&& !Anope::Match(host, e->host, false))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
|
||||
+3
-3
@@ -2202,11 +2202,11 @@ AutoKick *is_stuck(ChannelInfo * ci, const char *mask)
|
||||
|| !(akick->flags & AK_STUCK))
|
||||
continue;
|
||||
/* Example: mask = *!*@*.org and akick->u.mask = *!*@*.anope.org */
|
||||
if (match_wild_nocase(mask, akick->u.mask))
|
||||
if (Anope::Match(akick->u.mask, mask, false))
|
||||
return akick;
|
||||
if (ircd->reversekickcheck) {
|
||||
/* Example: mask = *!*@irc.anope.org and akick->u.mask = *!*@*.anope.org */
|
||||
if (match_wild_nocase(akick->u.mask, mask))
|
||||
if (Anope::Match(mask, akick->u.mask, false))
|
||||
return akick;
|
||||
}
|
||||
}
|
||||
@@ -2240,7 +2240,7 @@ void stick_mask(ChannelInfo * ci, AutoKick * akick)
|
||||
if (ircd->reversekickcheck) {
|
||||
/* If akick is wider than a ban already in place.
|
||||
Example: c->bans[i] = *!*@irc.epona.org and akick->u.mask = *!*@*.epona.org */
|
||||
if (match_wild_nocase(akick->u.mask, ban->mask))
|
||||
if (Anope::Match(ban->mask, akick->u.mask, false))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class CommandBSBadwords : public Command
|
||||
if (!(ci->badwords[i].in_use))
|
||||
continue;
|
||||
if (word && ci->badwords[i].word
|
||||
&& !match_wild_nocase(word, ci->badwords[i].word))
|
||||
&& !Anope::Match(ci->badwords[i].word, word, false))
|
||||
continue;
|
||||
badwords_list(u, i, ci, &sent_header);
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ class CommandCSAccess : public Command
|
||||
} else {
|
||||
for (i = 0; i < ci->accesscount; i++) {
|
||||
if (nick && ci->access[i].nc
|
||||
&& !match_wild_nocase(nick, ci->access[i].nc->display))
|
||||
&& !Anope::Match(ci->access[i].nc->display, nick, false))
|
||||
continue;
|
||||
access_list(u, i, ci, &sent_header);
|
||||
}
|
||||
|
||||
+5
-5
@@ -264,7 +264,7 @@ class CommandCSAKick : public Command
|
||||
if (na2->nc && ((na2->nc == ci->founder) || (get_access_nc(na2->nc, ci)
|
||||
>= get_access(u, ci)))) {
|
||||
snprintf(buf, BUFSIZE, "%s!%s", na2->nick, na2->last_usermask);
|
||||
if (match_wild_nocase(mask, buf)) {
|
||||
if (Anope::Match(buf, mask, false)) {
|
||||
notice_lang(s_ChanServ, u, PERMISSION_DENIED);
|
||||
delete [] mask;
|
||||
return MOD_CONT;
|
||||
@@ -536,10 +536,10 @@ class CommandCSAKick : public Command
|
||||
continue;
|
||||
if (mask) {
|
||||
if (!(akick->flags & AK_ISNICK)
|
||||
&& !match_wild_nocase(mask, akick->u.mask))
|
||||
&& !Anope::Match(akick->u.mask, mask, false))
|
||||
continue;
|
||||
if ((akick->flags & AK_ISNICK)
|
||||
&& !match_wild_nocase(mask, akick->u.nc->display))
|
||||
&& !Anope::Match(akick->u.nc->display, mask, false))
|
||||
continue;
|
||||
}
|
||||
akick_list(u, i, ci, &sent_header);
|
||||
@@ -565,10 +565,10 @@ class CommandCSAKick : public Command
|
||||
continue;
|
||||
if (mask) {
|
||||
if (!(akick->flags & AK_ISNICK)
|
||||
&& !match_wild_nocase(mask, akick->u.mask))
|
||||
&& !Anope::Match(akick->u.mask, mask, false))
|
||||
continue;
|
||||
if ((akick->flags & AK_ISNICK)
|
||||
&& !match_wild_nocase(mask, akick->u.nc->display))
|
||||
&& !Anope::Match(akick->u.nc->display, mask, false))
|
||||
continue;
|
||||
}
|
||||
akick_view(u, i, ci, &sent_header);
|
||||
|
||||
+2
-2
@@ -136,8 +136,8 @@ public:
|
||||
|
||||
if ((stricmp(pattern, ci->name) == 0)
|
||||
|| (stricmp(spattern, ci->name) == 0)
|
||||
|| match_wild_nocase(pattern, ci->name)
|
||||
|| match_wild_nocase(spattern, ci->name))
|
||||
|| Anope::Match(ci->name, pattern, false)
|
||||
|| Anope::Match(ci->name, spattern, false))
|
||||
{
|
||||
if ((((count + 1 >= from) && (count + 1 <= to))
|
||||
|| ((from == 0) && (to == 0)))
|
||||
|
||||
+1
-1
@@ -354,7 +354,7 @@ class XOPBase : public Command
|
||||
{
|
||||
for (int i = 0; i < ci->accesscount; ++i)
|
||||
{
|
||||
if (nick && ci->access[i].nc && !match_wild_nocase(nick, ci->access[i].nc->display))
|
||||
if (nick && ci->access[i].nc && !Anope::Match(ci->access[i].nc->display, nick, false))
|
||||
continue;
|
||||
xop_list(u, i, ci, &sent_header, level, messages[XOP_LIST_HEADER]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ class CommandHSList : public Command
|
||||
{
|
||||
if (key)
|
||||
{
|
||||
if ((match_wild_nocase(key, current->nick) || match_wild_nocase(key, current->vHost)) && display_counter < NSListMax)
|
||||
if ((Anope::Match(current->nick, key, false) || Anope::Match(current->vHost, key, false)) && display_counter < NSListMax)
|
||||
{
|
||||
++display_counter;
|
||||
tm = localtime(¤t->time);
|
||||
|
||||
@@ -49,7 +49,7 @@ class CommandNSAccess : public Command
|
||||
notice_lang(s_NickServ, u, NICK_ACCESS_LIST_X, params[1].c_str());
|
||||
for (access = nc->access, i = 0; i < nc->accesscount; ++access, ++i)
|
||||
{
|
||||
if (mask && !match_wild(mask, *access))
|
||||
if (mask && !Anope::Match(*access, mask, true))
|
||||
continue;
|
||||
u->SendMessage(s_NickServ, " %s", *access);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ class CommandNSAccess : public Command
|
||||
notice_lang(s_NickServ, u, NICK_ACCESS_LIST);
|
||||
for (access = nc->access, i = 0; i < nc->accesscount; ++access, ++i)
|
||||
{
|
||||
if (mask && !match_wild(mask, *access))
|
||||
if (mask && !Anope::Match(*access, mask, true))
|
||||
continue;
|
||||
u->SendMessage(s_NickServ, " %s", *access);
|
||||
}
|
||||
|
||||
+2
-2
@@ -143,7 +143,7 @@ class CommandNSList : public Command
|
||||
* Instead we build a nice nick!user@host buffer to compare.
|
||||
* The output is then generated separately. -TheShadow */
|
||||
snprintf(buf, sizeof(buf), "%s!%s", na->nick, na->last_usermask && !(na->status & NS_FORBIDDEN) ? na->last_usermask : "*@*");
|
||||
if (!stricmp(pattern, na->nick) || match_wild_nocase(pattern, buf))
|
||||
if (!stricmp(pattern, na->nick) || Anope::Match(buf, pattern, false))
|
||||
{
|
||||
if (((count + 1 >= from && count + 1 <= to) || (!from && !to)) && ++nnicks <= NSListMax)
|
||||
{
|
||||
@@ -175,7 +175,7 @@ class CommandNSList : public Command
|
||||
for (nr = nrlists[i]; nr; nr = nr->next)
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s!*@*", nr->nick);
|
||||
if (!stricmp(pattern, nr->nick) || match_wild_nocase(pattern, buf))
|
||||
if (!stricmp(pattern, nr->nick) || Anope::Match(buf, pattern, false))
|
||||
{
|
||||
if (++nnicks <= NSListMax)
|
||||
{
|
||||
|
||||
+1
-1
@@ -180,7 +180,7 @@ class CommandOSAdmin : public Command
|
||||
int i;
|
||||
|
||||
for (i = 0; i < servadmins.count; ++i) {
|
||||
if (!stricmp(nick, (static_cast<NickCore *>(servadmins.list[i]))->display) || match_wild_nocase(nick, (static_cast<NickCore *>(servadmins.list[i]))->display))
|
||||
if (!stricmp(nick, (static_cast<NickCore *>(servadmins.list[i]))->display) || Anope::Match((static_cast<NickCore *>(servadmins.list[i]))->display, nick, false))
|
||||
admin_list(i + 1, static_cast<NickCore *>(servadmins.list[i]), u, &sent_header);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -225,7 +225,7 @@ class CommandOSAKill : public Command
|
||||
for (i = 0; i < akills.count; ++i)
|
||||
{
|
||||
snprintf(amask, sizeof(amask), "%s@%s", (static_cast<Akill *>(akills.list[i]))->user, (static_cast<Akill *>(akills.list[i]))->host);
|
||||
if (!stricmp(mask, amask) || match_wild_nocase(mask, amask))
|
||||
if (!stricmp(mask, amask) || Anope::Match(amask, mask, false))
|
||||
akill_list(i + 1, static_cast<Akill *>(akills.list[i]), u, &sent_header);
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ class CommandOSAKill : public Command
|
||||
for (i = 0; i < akills.count; ++i)
|
||||
{
|
||||
snprintf(amask, sizeof(amask), "%s@%s", (static_cast<Akill *>(akills.list[i]))->user, (static_cast<Akill *>(akills.list[i]))->host);
|
||||
if (!stricmp(mask, amask) || match_wild_nocase(mask, amask))
|
||||
if (!stricmp(mask, amask) || Anope::Match(amask, mask, false))
|
||||
akill_view(i + 1, static_cast<Akill *>(akills.list[i]), u, &sent_header);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ class CommandOSChanList : public Command
|
||||
{
|
||||
for (c = chanlist[i]; c; c = c->next)
|
||||
{
|
||||
if (pattern && !match_wild_nocase(pattern, c->name))
|
||||
if (pattern && !Anope::Match(c->name, pattern, false))
|
||||
continue;
|
||||
if (modes && !(c->mode & modes))
|
||||
continue;
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ class CommandOSNOOP : public Command
|
||||
for (u2 = firstuser(); u2; u2 = u3)
|
||||
{
|
||||
u3 = nextuser();
|
||||
if (u2 && is_oper(u2) && u2->server->name && match_wild(server, u2->server->name))
|
||||
if (u2 && is_oper(u2) && u2->server->name && Anope::Match(u2->server->name, server, true))
|
||||
kill_user(s_OperServ, u2->nick, reason);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -187,7 +187,7 @@ class CommandOSOper : public Command
|
||||
|
||||
for (i = 0; i < servopers.count; ++i)
|
||||
{
|
||||
if (!stricmp(nick, (static_cast<NickCore *>(servopers.list[i]))->display) || match_wild_nocase(nick, (static_cast<NickCore *>(servopers.list[i]))->display))
|
||||
if (!stricmp(nick, (static_cast<NickCore *>(servopers.list[i]))->display) || Anope::Match((static_cast<NickCore *>(servopers.list[i]))->display, nick, false))
|
||||
oper_list(i + 1, static_cast<NickCore *>(servopers.list[i]), u, &sent_header);
|
||||
}
|
||||
|
||||
|
||||
@@ -382,7 +382,7 @@ class CommandOSException : public Command
|
||||
{
|
||||
for (i = 0; i < nexceptions; ++i)
|
||||
{
|
||||
if (!mask || match_wild_nocase(mask, exceptions[i].mask))
|
||||
if (!mask || Anope::Match(exceptions[i].mask, mask, false))
|
||||
exception_list(u, i, &sent_header);
|
||||
}
|
||||
}
|
||||
@@ -404,7 +404,7 @@ class CommandOSException : public Command
|
||||
{
|
||||
for (i = 0; i < nexceptions; ++i)
|
||||
{
|
||||
if (!mask || match_wild_nocase(mask, exceptions[i].mask))
|
||||
if (!mask || Anope::Match(exceptions[i].mask, mask, false))
|
||||
exception_view(u, i, &sent_header);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ class CommandOSSGLine : public Command
|
||||
for (i = 0; i < sglines.count; ++i)
|
||||
{
|
||||
amask = (static_cast<SXLine *>(sglines.list[i]))->mask;
|
||||
if (!stricmp(mask, amask) || match_wild_nocase(mask, amask))
|
||||
if (!stricmp(mask, amask) || Anope::Match(amask, mask, false))
|
||||
sgline_list(i + 1, static_cast<SXLine *>(sglines.list[i]), u, &sent_header);
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ class CommandOSSGLine : public Command
|
||||
for (i = 0; i < sglines.count; ++i)
|
||||
{
|
||||
amask = (static_cast<SXLine *>(sglines.list[i]))->mask;
|
||||
if (!stricmp(mask, amask) || match_wild_nocase(mask, amask))
|
||||
if (!stricmp(mask, amask) || Anope::Match(amask, mask, false))
|
||||
sgline_view(i + 1, static_cast<SXLine *>(sglines.list[i]), u, &sent_header);
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ class CommandOSSQLine : public Command
|
||||
for (i = 0; i < sqlines.count; ++i)
|
||||
{
|
||||
amask = (static_cast<SXLine *>(sqlines.list[i]))->mask;
|
||||
if (!stricmp(mask, amask) || match_wild_nocase(mask, amask))
|
||||
if (!stricmp(mask, amask) || Anope::Match(amask, mask, false))
|
||||
sqline_list(i + 1, static_cast<SXLine *>(sqlines.list[i]), u, &sent_header);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ class CommandOSSQLine : public Command
|
||||
for (i = 0; i < sqlines.count; ++i)
|
||||
{
|
||||
amask = (static_cast<SXLine *>(sqlines.list[i]))->mask;
|
||||
if (!stricmp(mask, amask) || match_wild_nocase(mask, amask))
|
||||
if (!stricmp(mask, amask) || Anope::Match(amask, mask, false))
|
||||
sqline_view(i + 1, static_cast<SXLine *>(sqlines.list[i]), u, &sent_header);
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ class CommandOSSZLine : public Command
|
||||
for (i = 0; i < szlines.count; ++i)
|
||||
{
|
||||
amask = (static_cast<SXLine *>(szlines.list[i]))->mask;
|
||||
if (!stricmp(mask, amask) || match_wild_nocase(mask, amask))
|
||||
if (!stricmp(mask, amask) || Anope::Match(amask, mask, false))
|
||||
szline_list(i + 1, static_cast<SXLine *>(szlines.list[i]), u, &sent_header);
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ class CommandOSSZLine : public Command
|
||||
for (i = 0; i < szlines.count; ++i)
|
||||
{
|
||||
amask = (static_cast<SXLine *>(szlines.list[i]))->mask;
|
||||
if (!stricmp(mask, amask) || match_wild_nocase(mask, amask))
|
||||
if (!stricmp(mask, amask) || Anope::Match(amask, mask, false))
|
||||
szline_view(i + 1, static_cast<SXLine *>(szlines.list[i]), u, &sent_header);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ class CommandOSUserList : public Command
|
||||
if (pattern)
|
||||
{
|
||||
snprintf(mask, sizeof(mask), "%s!%s@%s", u2->nick, u2->GetIdent().c_str(), u2->GetDisplayedHost().c_str());
|
||||
if (!match_wild_nocase(pattern, mask))
|
||||
if (!Anope::Match(mask, pattern, false))
|
||||
continue;
|
||||
if (modes && !(u2->mode & modes))
|
||||
continue;
|
||||
|
||||
-29
@@ -209,35 +209,6 @@ const char *merge_args(int argc, char **argv)
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* match_wild: Case Senstive wild card search
|
||||
* @param pattern To be matched
|
||||
* @param str String in which the pattern is to be matched
|
||||
* @return 1 if the string matches the pattern, 0 if not.
|
||||
* NOTE: Deprecated by Anope::Match().
|
||||
*/
|
||||
int match_wild(const char *pattern, const char *str)
|
||||
{
|
||||
return Anope::Match(str, pattern, true);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* match_wild: Case Insenstive wild card search
|
||||
* @param pattern To be matched
|
||||
* @param str String in which the pattern is to be matched
|
||||
* @return 1 if the string matches the pattern, 0 if not.
|
||||
* NOTE: Deprecated by Anope::Match().
|
||||
*/
|
||||
int match_wild_nocase(const char *pattern, const char *str)
|
||||
{
|
||||
return Anope::Match(str, pattern, false);
|
||||
}
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
/**
|
||||
* Process a string containing a number/range list in the form
|
||||
* "n1[-n2][,n3[-n4]]...", calling a caller-specified routine for each
|
||||
|
||||
+2
-2
@@ -864,8 +864,8 @@ int is_on_access(User * u, NickCore * nc)
|
||||
|
||||
for (i = 0; i < nc->accesscount; i++)
|
||||
{
|
||||
if (match_wild_nocase(nc->access[i], buf)
|
||||
|| (ircd->vhost ? match_wild_nocase(nc->access[i], buf2) : 0))
|
||||
if (Anope::Match(buf, nc->access[i], false)
|
||||
|| (ircd->vhost ? Anope::Match(buf2, nc->access[i], false) : 0))
|
||||
{
|
||||
delete [] buf;
|
||||
if (ircd->vhost)
|
||||
|
||||
+20
-20
@@ -542,7 +542,7 @@ int add_akill(User * u, const char *mask, const char *by, const time_t expires,
|
||||
}
|
||||
}
|
||||
|
||||
if (match_wild_nocase(amask, mask)
|
||||
if (Anope::Match(mask, amask, false)
|
||||
&& (entry->expires >= expires || entry->expires == 0)) {
|
||||
if (u)
|
||||
notice_lang(s_OperServ, u, OPER_AKILL_ALREADY_COVERED,
|
||||
@@ -550,7 +550,7 @@ int add_akill(User * u, const char *mask, const char *by, const time_t expires,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (match_wild_nocase(mask, amask)
|
||||
if (Anope::Match(amask, mask, false)
|
||||
&& (entry->expires <= expires || expires == 0)) {
|
||||
slist_delete(&akills, i);
|
||||
deleted++;
|
||||
@@ -628,16 +628,16 @@ int check_akill(const char *nick, const char *username, const char *host,
|
||||
ak = static_cast<Akill *>(akills.list[i]);
|
||||
if (!ak)
|
||||
continue;
|
||||
if (match_wild_nocase(ak->user, username)
|
||||
&& match_wild_nocase(ak->host, host)) {
|
||||
if (Anope::Match(username, ak->user, false)
|
||||
&& Anope::Match(host, ak->host, false)) {
|
||||
ircdproto->SendAkill(ak->user, ak->host, ak->by, ak->seton,
|
||||
ak->expires, ak->reason);
|
||||
return 1;
|
||||
}
|
||||
if (ircd->vhost) {
|
||||
if (vhost) {
|
||||
if (match_wild_nocase(ak->user, username)
|
||||
&& match_wild_nocase(ak->host, vhost)) {
|
||||
if (Anope::Match(username, ak->user, false)
|
||||
&& Anope::Match(vhost, ak->host, false)) {
|
||||
ircdproto->SendAkill(ak->user, ak->host, ak->by, ak->seton,
|
||||
ak->expires, ak->reason);
|
||||
return 1;
|
||||
@@ -646,8 +646,8 @@ int check_akill(const char *nick, const char *username, const char *host,
|
||||
}
|
||||
if (ircd->nickip) {
|
||||
if (ip) {
|
||||
if (match_wild_nocase(ak->user, username)
|
||||
&& match_wild_nocase(ak->host, ip)) {
|
||||
if (Anope::Match(username, ak->user, false)
|
||||
&& Anope::Match(ip, ak->host, false)) {
|
||||
ircdproto->SendAkill(ak->user, ak->host, ak->by, ak->seton,
|
||||
ak->expires, ak->reason);
|
||||
return 1;
|
||||
@@ -766,7 +766,7 @@ int add_sgline(User * u, const char *mask, const char *by, time_t expires,
|
||||
}
|
||||
}
|
||||
|
||||
if (match_wild_nocase(entry->mask, mask)
|
||||
if (Anope::Match(mask, entry->mask, false )
|
||||
&& (entry->expires >= expires || entry->expires == 0)) {
|
||||
if (u)
|
||||
notice_lang(s_OperServ, u, OPER_SGLINE_ALREADY_COVERED,
|
||||
@@ -774,7 +774,7 @@ int add_sgline(User * u, const char *mask, const char *by, time_t expires,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (match_wild_nocase(mask, entry->mask)
|
||||
if (Anope::Match(entry->mask, mask, false)
|
||||
&& (entry->expires <= expires || expires == 0)) {
|
||||
slist_delete(&sglines, i);
|
||||
deleted++;
|
||||
@@ -812,7 +812,7 @@ int add_sgline(User * u, const char *mask, const char *by, time_t expires,
|
||||
while (u2) {
|
||||
next = nextuser();
|
||||
if (!is_oper(u2)) {
|
||||
if (match_wild_nocase(entry->mask, u2->realname)) {
|
||||
if (Anope::Match(u2->realname, entry->mask, false)) {
|
||||
kill_user(ServerName, u2->nick, buf);
|
||||
}
|
||||
}
|
||||
@@ -837,7 +837,7 @@ int check_sgline(const char *nick, const char *realname)
|
||||
if (!sx)
|
||||
continue;
|
||||
|
||||
if (match_wild_nocase(sx->mask, realname)) {
|
||||
if (Anope::Match(realname, sx->mask, false)) {
|
||||
ircdproto->SendSGLine(sx->mask, sx->reason);
|
||||
/* We kill nick since s_sgline can't */
|
||||
ircdproto->SendSVSKill(ServerName, nick, "G-Lined: %s", sx->reason);
|
||||
@@ -953,7 +953,7 @@ int add_sqline(User * u, const char *mask, const char *by, time_t expires,
|
||||
}
|
||||
}
|
||||
|
||||
if (match_wild_nocase(entry->mask, mask)
|
||||
if (Anope::Match(mask, entry->mask, false)
|
||||
&& (entry->expires >= expires || entry->expires == 0)) {
|
||||
if (u)
|
||||
notice_lang(s_OperServ, u, OPER_SQLINE_ALREADY_COVERED,
|
||||
@@ -961,7 +961,7 @@ int add_sqline(User * u, const char *mask, const char *by, time_t expires,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (match_wild_nocase(mask, entry->mask)
|
||||
if (Anope::Match(entry->mask, mask, false)
|
||||
&& (entry->expires <= expires || expires == 0)) {
|
||||
slist_delete(&sqlines, i);
|
||||
deleted++;
|
||||
@@ -999,7 +999,7 @@ int add_sqline(User * u, const char *mask, const char *by, time_t expires,
|
||||
while (u2) {
|
||||
next = nextuser();
|
||||
if (!is_oper(u2)) {
|
||||
if (match_wild_nocase(entry->mask, u2->nick)) {
|
||||
if (Anope::Match(u2->nick, entry->mask, false)) {
|
||||
kill_user(ServerName, u2->nick, buf);
|
||||
}
|
||||
}
|
||||
@@ -1031,7 +1031,7 @@ int check_sqline(const char *nick, int nick_change)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (match_wild_nocase(sx->mask, nick)) {
|
||||
if (Anope::Match(nick, sx->mask, false)) {
|
||||
sqline(sx->mask, sx->reason);
|
||||
/* We kill nick since s_sqline can't */
|
||||
snprintf(reason, sizeof(reason), "Q-Lined: %s", sx->reason);
|
||||
@@ -1059,7 +1059,7 @@ int check_chan_sqline(const char *chan)
|
||||
if (*sx->mask != '#')
|
||||
continue;
|
||||
|
||||
if (match_wild_nocase(sx->mask, chan)) {
|
||||
if (Anope::Match(chan, sx->mask, false)) {
|
||||
sqline(sx->mask, sx->reason);
|
||||
return 1;
|
||||
}
|
||||
@@ -1167,14 +1167,14 @@ int add_szline(User * u, const char *mask, const char *by, time_t expires,
|
||||
}
|
||||
}
|
||||
|
||||
if (match_wild_nocase(entry->mask, mask)) {
|
||||
if (Anope::Match(mask, entry->mask, false)) {
|
||||
if (u)
|
||||
notice_lang(s_OperServ, u, OPER_SZLINE_ALREADY_COVERED,
|
||||
mask, entry->mask);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (match_wild_nocase(mask, entry->mask)) {
|
||||
if (Anope::Match(entry->mask, mask, false)) {
|
||||
slist_delete(&szlines, i);
|
||||
deleted++;
|
||||
}
|
||||
@@ -1227,7 +1227,7 @@ int check_szline(const char *nick, char *ip)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (match_wild_nocase(sx->mask, ip)) {
|
||||
if (Anope::Match(ip, sx->mask, false)) {
|
||||
ircdproto->SendSZLine(sx->mask, sx->reason, sx->by);
|
||||
return 1;
|
||||
}
|
||||
|
||||
+1
-1
@@ -135,7 +135,7 @@ IgnoreData *get_ignore(const char *nick)
|
||||
} else
|
||||
snprintf(tmp, sizeof(tmp), "%s!*@*", nick);
|
||||
for (ign = ignore; ign; ign = ign->next)
|
||||
if (match_wild_nocase(ign->mask, tmp))
|
||||
if (Anope::Match(tmp, ign->mask, false))
|
||||
break;
|
||||
}
|
||||
/* Check whether the entry has timed out */
|
||||
|
||||
+3
-3
@@ -280,7 +280,7 @@ Exception *find_host_exception(const char *host)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nexceptions; i++) {
|
||||
if ((match_wild_nocase(exceptions[i].mask, host))) {
|
||||
if ((Anope::Match(host, exceptions[i].mask, false))) {
|
||||
return &exceptions[i];
|
||||
}
|
||||
}
|
||||
@@ -295,9 +295,9 @@ Exception *find_hostip_exception(const char *host, const char *hostip)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nexceptions; i++) {
|
||||
if ((match_wild_nocase(exceptions[i].mask, host))
|
||||
if ((Anope::Match(host, exceptions[i].mask, false))
|
||||
|| ((ircd->nickip && hostip)
|
||||
&& (match_wild_nocase(exceptions[i].mask, hostip)))) {
|
||||
&& (Anope::Match(hostip, exceptions[i].mask, false)))) {
|
||||
return &exceptions[i];
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -928,14 +928,14 @@ int match_usermask(const char *mask, User * user)
|
||||
}
|
||||
|
||||
if (nick) {
|
||||
result = match_wild_nocase(nick, user->nick)
|
||||
&& match_wild_nocase(username, user->GetIdent().c_str())
|
||||
&& (match_wild_nocase(host, user->host)
|
||||
|| match_wild_nocase(host, user->vhost));
|
||||
result = Anope::Match(user->nick, nick, false)
|
||||
&& Anope::Match(user->GetIdent().c_str(), username, false)
|
||||
&& (Anope::Match(user->host, host, false)
|
||||
|| Anope::Match(user->vhost, host, false));
|
||||
} else {
|
||||
result = match_wild_nocase(username, user->GetIdent().c_str())
|
||||
&& (match_wild_nocase(host, user->host)
|
||||
|| match_wild_nocase(host, user->vhost));
|
||||
result = Anope::Match(user->GetIdent().c_str(), username, false)
|
||||
&& (Anope::Match(user->host, host, false)
|
||||
|| Anope::Match(user->vhost, host, false));
|
||||
}
|
||||
|
||||
delete [] mask2;
|
||||
|
||||
Reference in New Issue
Block a user