summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/extern.h2
-rw-r--r--src/actions.c2
-rw-r--r--src/botserv.c2
-rw-r--r--src/channels.c12
-rw-r--r--src/modes.cpp2
5 files changed, 10 insertions, 10 deletions
diff --git a/include/extern.h b/include/extern.h
index 2a5a95bd4..ed9b86e40 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -108,7 +108,7 @@ E Entry *entry_create(char *mask);
E Entry *entry_add(EList *list, const char *mask);
E void entry_delete(EList *list, Entry *e);
E EList *list_create();
-E int entry_match(Entry *e, const std::string &nick, const std::string &user, const std::string &host, uint32 ip);
+E int entry_match(Entry *e, const ci::string &nick, const ci::string &user, const ci::string &host, uint32 ip);
E int entry_match_mask(Entry *e, const char *mask, uint32 ip);
E Entry *elist_match(EList *list, const char *nick, const char *user, const char *host, uint32 ip);
E Entry *elist_match_mask(EList *list, const char *mask, uint32 ip);
diff --git a/src/actions.c b/src/actions.c
index 1d2b7d2e4..0e15f2cf4 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -158,7 +158,7 @@ void common_unban(ChannelInfo *ci, const std::string &nick)
for (ban = ci->c->bans->entries; ban; ban = next)
{
next = ban->next;
- if (entry_match(ban, u->nick, u->GetIdent(), u->host, ip) || entry_match(ban, u->nick, u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip))
+ if (entry_match(ban, u->nick.c_str(), u->GetIdent().c_str(), u->host, ip) || entry_match(ban, u->nick.c_str(), u->GetIdent().c_str(), u->GetDisplayedHost().c_str(), ip))
ci->c->RemoveMode(NULL, CMODE_BAN, ban->mask);
}
}
diff --git a/src/botserv.c b/src/botserv.c
index 148d71b97..faf6bf3b8 100644
--- a/src/botserv.c
+++ b/src/botserv.c
@@ -630,7 +630,7 @@ void bot_join(ChannelInfo * ci)
{
next = ban->next;
- if (entry_match(ban, ci->bi->nick, ci->bi->user, ci->bi->host, 0))
+ if (entry_match(ban, ci->bi->nick.c_str(), ci->bi->user.c_str(), ci->bi->host.c_str(), 0))
{
ci->c->RemoveMode(NULL, CMODE_BAN, ban->mask);
}
diff --git a/src/channels.c b/src/channels.c
index bc1b17f17..1730dcf7c 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -2309,7 +2309,7 @@ EList *list_create()
* @param ip IP to match against, set to 0 to not match this
* @return 1 for a match, 0 for no match
*/
-int entry_match(Entry *e, const std::string &nick, const std::string &user, const std::string &host, uint32 ip)
+int entry_match(Entry *e, const ci::string &nick, const ci::string &user, const ci::string &host, uint32 ip)
{
/* If we don't get an entry, or it s an invalid one, no match ~ Viper */
if (!e || !e->FlagCount())
@@ -2324,11 +2324,11 @@ int entry_match(Entry *e, const std::string &nick, const std::string &user, cons
return 0;
if (e->HasFlag(ENTRYTYPE_HOST) && (host.empty() || host != e->host))
return 0;
- if (e->HasFlag(ENTRYTYPE_NICK_WILD) && !Anope::Match(nick, e->nick, false))
+ if (e->HasFlag(ENTRYTYPE_NICK_WILD) && !Anope::Match(nick, e->nick))
return 0;
- if (e->HasFlag(ENTRYTYPE_USER_WILD) && !Anope::Match(user, e->user, false))
+ if (e->HasFlag(ENTRYTYPE_USER_WILD) && !Anope::Match(user, e->user))
return 0;
- if (e->HasFlag(ENTRYTYPE_HOST_WILD) && !Anope::Match(host, e->host, false))
+ if (e->HasFlag(ENTRYTYPE_HOST_WILD) && !Anope::Match(host, e->host))
return 0;
return 1;
@@ -2365,7 +2365,7 @@ int entry_match_mask(Entry * e, const char *mask, uint32 ip)
host = hostmask;
}
- res = entry_match(e, nick, user, host, ip);
+ res = entry_match(e, nick ? nick : "", user ? user : "", host ? host : "", ip);
/* Free the destroyed mask. */
delete [] hostmask;
@@ -2391,7 +2391,7 @@ Entry *elist_match(EList * list, const char *nick, const char *user, const char
return NULL;
for (e = list->entries; e; e = e->next) {
- if (entry_match(e, nick, user, host, ip))
+ if (entry_match(e, nick ? nick : "", user ? user : "", host ? host : "", ip))
return e;
}
diff --git a/src/modes.cpp b/src/modes.cpp
index 8d4f99d05..dd608af43 100644
--- a/src/modes.cpp
+++ b/src/modes.cpp
@@ -241,7 +241,7 @@ void ChannelModeBan::AddMask(Channel *chan, const char *mask)
{
BotInfo *bi = chan->ci->bi;
- if (entry_match(ban, bi->nick, bi->user, bi->host, 0))
+ if (entry_match(ban, bi->nick.c_str(), bi->user.c_str(), bi->host.c_str(), 0))
{
ircdproto->SendMode(bi, chan, "-b %s", mask);
entry_delete(chan->bans, ban);