+ std::string rm(mask, 2);
+ char status = 0;
+ const PrefixMode* const mh = ServerInstance->Modes->FindPrefix(rm[0]);
+ if (mh)
+ {
+ rm.assign(mask, 3, std::string::npos);
+ status = mh->GetModeChar();
+ }
+ for (User::ChanList::iterator i = user->chans.begin(); i != user->chans.end(); i++)
+ {
+ if (InspIRCd::Match((*i)->chan->name, rm))
+ {
+ if ((!status) || ((*i)->HasMode(mh)))
+ return MOD_RES_DENY;
+ }
+ }