+ std::string rm(mask, 2);
+ char status = 0;
+ ModeHandler* 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(status))
+ return MOD_RES_DENY;
+ }
+ }