- int result = 0;
- FOREACH_RESULT_MAP(I_OnCheckStringExtBan, OnCheckStringExtBan(str, this, type),
- result = banmatch_reduce(result, MOD_RESULT);
- );
-
- if (result)
- return result;
-
- // nobody decided for us, check the ban list
- for (BanList::iterator i = this->bans.begin(); i != this->bans.end(); i++)
+ ModResult result;
+ FIRST_MOD_RESULT(OnCheckBan, result, (user, this, mask));
+ if (result != MOD_RES_PASSTHRU)
+ return (result == MOD_RES_DENY);
+
+ // extbans were handled above, if this is one it obviously didn't match
+ if ((mask.length() <= 2) || (mask[1] == ':'))
+ return false;
+
+ std::string::size_type at = mask.find('@');
+ if (at == std::string::npos)
+ return false;
+
+ char tomatch[MAXBUF];
+ snprintf(tomatch, MAXBUF, "%s!%s", user->nick.c_str(), user->ident.c_str());
+ std::string prefix = mask.substr(0, at);
+ if (InspIRCd::Match(tomatch, prefix, NULL))