return MODEACTION_DENY;
}
-std::pair<bool,std::string> ModeHandler::ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter)
+ModePair ModeHandler::ModeSet(userrec* source, userrec* dest, chanrec* channel, const std::string ¶meter)
{
if (dest)
{
* (e.g. are they a (half)op?
*/
- if (cstatus(user, targetchannel) < STATUS_HOP)
+ if ((IS_LOCAL(user)) && (cstatus(user, targetchannel) < STATUS_HOP))
{
/* We don't have halfop */
log(DEBUG,"The user is not a halfop or above, checking other reasons for being able to set the modes");
return true;
}
+ModeHandler* ModeParser::FindMode(unsigned const char modeletter, ModeType mt)
+{
+ unsigned char mask = 0;
+ unsigned char pos = 0;
+
+ if ((modeletter < 'A') || (modeletter > 'z'))
+ return NULL;
+
+ mt == MODETYPE_USER ? mask = MASK_USER : mask = MASK_CHANNEL;
+ pos = (modeletter-65) | mask;
+
+ return modehandlers[pos];
+}
+
bool ModeParser::AddModeWatcher(ModeWatcher* mw)
{
unsigned char mask = 0;