- unsigned int mypfx = chan->GetPrefixValue(user);
- irc::spacesepstream defaultstream(defaults);
- char minmode = 0;
- std::string current;
-
- while (defaultstream.GetToken(current))
- {
- std::string::size_type pos = current.find(':');
- if (pos == std::string::npos)
- continue;
- if (current.substr(pos+1) == restriction)
- minmode = current[0];
- }
- modelist* list = ec.extItem.get(chan);
-
- if (list)
- {
- for (modelist::iterator i = list->begin(); i != list->end(); ++i)
- {
- std::string::size_type pos = i->mask.find(':');
- if (pos == std::string::npos)
- continue;
- if (i->mask.substr(pos+1) == restriction)
- minmode = i->mask[0];
- }
- }
-
- ModeHandler* mh = ServerInstance->Modes->FindMode(minmode, MODETYPE_CHANNEL);
- if (mh && mypfx >= mh->GetPrefixRank())
- return MOD_RES_ALLOW;
- if (mh || minmode == '*')
- return MOD_RES_DENY;
- return MOD_RES_PASSTHRU;