diff options
Diffstat (limited to 'include/channels.h')
-rw-r--r-- | include/channels.h | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/include/channels.h b/include/channels.h index 9b018b23e..ba2018e97 100644 --- a/include/channels.h +++ b/include/channels.h @@ -24,6 +24,7 @@ #include "membership.h" #include "mode.h" +#include "parammode.h" /** Holds an entry for a ban list, exemption list, or invite list. * This class contains a single element in a channel list, such as a banlist. @@ -47,11 +48,6 @@ class CoreExport Channel : public Extensible, public InviteBase<Channel> */ std::bitset<64> modes; - /** Parameters for custom modes. - * One for each custom mode letter. - */ - CustomModeList custom_mode_params; - /** Remove the given membership from the channel's internal map of * memberships and destroy the Membership object. * This function does not remove the channel from User::chanlist. @@ -113,13 +109,6 @@ class CoreExport Channel : public Extensible, public InviteBase<Channel> */ void SetMode(ModeHandler* mode, bool value); - /** Sets or unsets a custom mode in the channels info - * @param mode The mode character to set or unset - * @param parameter The parameter string to associate with this mode character. - * If it is empty, the mode is unset; if it is nonempty, the mode is set. - */ - void SetModeParam(ModeHandler* mode, const std::string& parameter); - /** Returns true if a mode is set on a channel * @param mode The mode character you wish to query * @return True if the custom mode is set, false if otherwise @@ -140,6 +129,7 @@ class CoreExport Channel : public Extensible, public InviteBase<Channel> */ std::string GetModeParameter(ModeHandler* mode); std::string GetModeParameter(ChanModeReference& mode); + std::string GetModeParameter(ParamModeBase* pm); /** Sets the channel topic. * @param user The user setting the topic. @@ -344,6 +334,23 @@ inline std::string Channel::GetModeParameter(ChanModeReference& mode) return GetModeParameter(*mode); } +inline std::string Channel::GetModeParameter(ModeHandler* mh) +{ + std::string out; + ParamModeBase* pm = mh->IsParameterMode(); + if (pm && this->IsModeSet(pm)) + pm->GetParameter(this, out); + return out; +} + +inline std::string Channel::GetModeParameter(ParamModeBase* pm) +{ + std::string out; + if (this->IsModeSet(pm)) + pm->GetParameter(this, out); + return out; +} + inline bool Channel::IsModeSet(ChanModeReference& mode) { if (!mode) |