return false;
}
-std::string ModeHandler::GetUserParameter(User* user)
+std::string ModeHandler::GetUserParameter(const User* user) const
{
return "";
}
ServerInstance->Modes->DelModeWatcher(this);
}
-ModeType ModeWatcher::GetModeType()
-{
- return m_type;
-}
-
bool ModeWatcher::BeforeMode(User*, User*, Channel*, std::string&, bool)
{
return true;
unsigned int ourrank = chan->GetPrefixValue(user);
if (ourrank < neededrank)
{
- PrefixMode* neededmh = NULL;
- for(char c='A'; c <= 'z'; c++)
+ const PrefixMode* neededmh = NULL;
+ const PrefixModeList& prefixmodes = GetPrefixModes();
+ for (PrefixModeList::const_iterator i = prefixmodes.begin(); i != prefixmodes.end(); ++i)
{
- PrefixMode* privmh = FindPrefixMode(c);
- if (privmh && privmh->GetPrefixRank() >= neededrank)
+ const PrefixMode* const privmh = *i;
+ if (privmh->GetPrefixRank() >= neededrank)
{
// this mode is sufficient to allow this action
if (!neededmh || privmh->GetPrefixRank() < neededmh->GetPrefixRank())
}
}
- if (adding && IS_LOCAL(user) && mh->NeedsOper() && !user->HasModePermission(modechar, type))
+ if ((adding) && (IS_LOCAL(user)) && (mh->NeedsOper()) && (!user->HasModePermission(mh)))
{
/* It's an oper only mode, and they don't have access to it. */
if (user->IsOper())
const Channel::MemberMap& userlist = chan->GetUsers();
for (Channel::MemberMap::const_iterator i = userlist.begin(); i != userlist.end(); ++i)
{
- if (i->second->hasMode(this->GetModeChar()))
+ if (i->second->HasMode(this))
changelist.push_remove(this, i->first->nick);
}
}