- virtual ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
- {
- return OnUserPreMessage(user, dest, target_type, text, status, exempt_list);
+ if ((mask.length() > 2) && (mask[1] == ':'))
+ {
+ if (mask[0] == 'R')
+ {
+ std::string *account = accountname.get(user);
+ if (account && InspIRCd::Match(*account, mask.substr(2)))
+ return MOD_RES_DENY;
+ }
+ else if (mask[0] == 'U')
+ {
+ std::string *account = accountname.get(user);
+ /* If the user is registered we don't care. */
+ if (account)
+ return MOD_RES_PASSTHRU;
+
+ /* If we made it this far we know the user isn't registered
+ so just deny if it matches */
+ checking = true;
+ bool result = chan->CheckBan(user, mask.substr(2));
+ checking = false;
+
+ if (result)
+ return MOD_RES_DENY;
+ }
+ }
+
+ /* If we made it this far then the ban wasn't an ExtBan
+ or the user we were checking for didn't match either ExtBan */
+ return MOD_RES_PASSTHRU;