diff options
-rw-r--r-- | include/mode.h | 6 | ||||
-rw-r--r-- | src/commands/cmd_lusers.cpp | 2 | ||||
-rw-r--r-- | src/mode.cpp | 10 | ||||
-rw-r--r-- | src/modules/m_banredirect.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_operprefix.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_timedbans.cpp | 2 |
6 files changed, 13 insertions, 15 deletions
diff --git a/include/mode.h b/include/mode.h index 2cc5d6681..32c87d8b0 100644 --- a/include/mode.h +++ b/include/mode.h @@ -383,11 +383,10 @@ class CoreExport ModeWatcher : public classbase * If you alter the parameter you are given, the mode handler will see your atered version * when it handles the mode. * @param adding True if the mode is being added and false if it is being removed - * @param type The mode type, either MODETYPE_USER or MODETYPE_CHANNEL * @return True to allow the mode change to go ahead, false to abort it. If you abort the * change, the mode handler (and ModeWatcher::AfterMode()) will never see the mode change. */ - virtual bool BeforeMode(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, ModeType type); + virtual bool BeforeMode(User* source, User* dest, Channel* channel, std::string& parameter, bool adding); /** * After the mode character has been processed by the ModeHandler, this method will be called. * @param source The sender of the mode @@ -396,9 +395,8 @@ class CoreExport ModeWatcher : public classbase * @param parameter The parameter of the mode, if the mode is supposed to have a parameter. * You cannot alter the parameter here, as the mode handler has already processed it. * @param adding True if the mode is being added and false if it is being removed - * @param type The mode type, either MODETYPE_USER or MODETYPE_CHANNEL */ - virtual void AfterMode(User* source, User* dest, Channel* channel, const std::string ¶meter, bool adding, ModeType type); + virtual void AfterMode(User* source, User* dest, Channel* channel, const std::string& parameter, bool adding); }; typedef std::vector<ModeWatcher*>::iterator ModeWatchIter; diff --git a/src/commands/cmd_lusers.cpp b/src/commands/cmd_lusers.cpp index 91a718090..d3dde949c 100644 --- a/src/commands/cmd_lusers.cpp +++ b/src/commands/cmd_lusers.cpp @@ -114,7 +114,7 @@ public: { } - void AfterMode(User* source, User* dest, Channel* channel, const std::string& parameter, bool adding, ModeType type) + void AfterMode(User* source, User* dest, Channel* channel, const std::string& parameter, bool adding) { if (dest->registered != REG_ALL) return; diff --git a/src/mode.cpp b/src/mode.cpp index a9ac006ae..1fc2af407 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -175,12 +175,12 @@ ModeType ModeWatcher::GetModeType() return m_type; } -bool ModeWatcher::BeforeMode(User*, User*, Channel*, std::string&, bool, ModeType) +bool ModeWatcher::BeforeMode(User*, User*, Channel*, std::string&, bool) { return true; } -void ModeWatcher::AfterMode(User*, User*, Channel*, const std::string&, bool, ModeType) +void ModeWatcher::AfterMode(User*, User*, Channel*, const std::string&, bool) { } @@ -273,7 +273,7 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++) { - if ((*watchers)->BeforeMode(user, targetuser, chan, parameter, adding, type) == false) + if ((*watchers)->BeforeMode(user, targetuser, chan, parameter, adding) == false) return MODEACTION_DENY; /* A module whacked the parameter completely, and there was one. abort. */ if (pcnt && parameter.empty()) @@ -332,7 +332,7 @@ ModeAction ModeParser::TryMode(User* user, User* targetuser, Channel* chan, bool return ma; for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++) - (*watchers)->AfterMode(user, targetuser, chan, parameter, adding, type); + (*watchers)->AfterMode(user, targetuser, chan, parameter, adding); return MODEACTION_ALLOW; } @@ -533,7 +533,7 @@ void ModeParser::DisplayListModes(User* user, Channel* chan, std::string &mode_s { std::string dummyparam; - if (!((*watchers)->BeforeMode(user, NULL, chan, dummyparam, true, MODETYPE_CHANNEL))) + if (!((*watchers)->BeforeMode(user, NULL, chan, dummyparam, true))) display = false; } if (display) diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp index 332e625e0..8e4c5c6e5 100644 --- a/src/modules/m_banredirect.cpp +++ b/src/modules/m_banredirect.cpp @@ -56,7 +56,7 @@ class BanRedirect : public ModeWatcher { } - bool BeforeMode(User* source, User* dest, Channel* channel, std::string ¶m, bool adding, ModeType type) + bool BeforeMode(User* source, User* dest, Channel* channel, std::string ¶m, bool adding) { /* nick!ident@host -> nick!ident@host * nick!ident@host#chan -> nick!ident@host#chan @@ -65,7 +65,7 @@ class BanRedirect : public ModeWatcher * nick#chan -> nick!*@*#chan */ - if(channel && (type == MODETYPE_CHANNEL) && param.length()) + if ((channel) && !param.empty()) { BanRedirectList* redirects; diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp index 2360ae2a4..b0737cb9a 100644 --- a/src/modules/m_operprefix.cpp +++ b/src/modules/m_operprefix.cpp @@ -66,7 +66,7 @@ class HideOperWatcher : public ModeWatcher ModuleOperPrefixMode* parentmod; public: HideOperWatcher(ModuleOperPrefixMode* parent) : ModeWatcher((Module*) parent, 'H', MODETYPE_USER), parentmod(parent) {} - void AfterMode(User* source, User* dest, Channel* channel, const std::string ¶meter, bool adding, ModeType type); + void AfterMode(User* source, User* dest, Channel* channel, const std::string ¶meter, bool adding); }; class ModuleOperPrefixMode : public Module @@ -159,7 +159,7 @@ class ModuleOperPrefixMode : public Module } }; -void HideOperWatcher::AfterMode(User* source, User* dest, Channel* channel, const std::string& parameter, bool adding, ModeType type) +void HideOperWatcher::AfterMode(User* source, User* dest, Channel* channel, const std::string& parameter, bool adding) { if (IS_LOCAL(dest)) parentmod->SetOperPrefix(dest, !adding); diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index 8a4fbb4dc..90b8fccdd 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -119,7 +119,7 @@ class BanWatcher : public ModeWatcher { } - void AfterMode(User* source, User* dest, Channel* chan, const std::string& banmask, bool adding, ModeType type) + void AfterMode(User* source, User* dest, Channel* chan, const std::string& banmask, bool adding) { if (adding) return; |