diff options
| author | Adam <Adam@drink-coca-cola.info> | 2010-05-15 00:56:52 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-06-18 21:01:55 -0400 |
| commit | ee57f5719301c3883afcffe5970746f378960917 (patch) | |
| tree | 994ac1f0dbc675e9950050a2332bb17da79d5f02 /include | |
| parent | c966d7ec17690037a597e1d8908782de376f3052 (diff) | |
Store modes in users and channels using the Flags class, cleaner
Diffstat (limited to 'include')
| -rw-r--r-- | include/channels.h | 4 | ||||
| -rw-r--r-- | include/extern.h | 4 | ||||
| -rw-r--r-- | include/regchannel.h | 6 | ||||
| -rw-r--r-- | include/users.h | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/include/channels.h b/include/channels.h index 4285a9f21..7814a377a 100644 --- a/include/channels.h +++ b/include/channels.h @@ -62,7 +62,7 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags> std::map<ChannelModeName, std::string> Params; /* Modes set on the channel */ - std::bitset<128> modes; + Flags<ChannelModeName> modes; public: /** Default constructor @@ -136,7 +136,7 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags> /** See if the channel has any modes at all * @return true or false */ - inline const bool HasModes() const { return modes.count(); } + inline const bool HasModes() const { return modes.FlagCount(); } /** See if a channel has a mode * @param Name The mode name diff --git a/include/extern.h b/include/extern.h index a10585e69..657452fd0 100644 --- a/include/extern.h +++ b/include/extern.h @@ -350,8 +350,8 @@ E int str_is_cidr(char *str, uint32 * ip, uint32 * mask, char **host); /**** modes.cpp ****/ /* Number of generic modes we support */ E unsigned GenericChannelModes, GenericUserModes; -E std::bitset<128> DefMLockOn; -E std::bitset<128> DefMLockOff; +E Flags<ChannelModeName> DefMLockOn; +E Flags<ChannelModeName> DefMLockOff; E std::map<ChannelModeName, std::string> DefMLockParams; /* Modes to set on bots when they join the channel */ E std::list<ChannelModeStatus *> BotModes; diff --git a/include/regchannel.h b/include/regchannel.h index 4a571182b..474b6f79a 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -67,9 +67,9 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag> std::map<ChannelModeName, std::string> Params; /* Map of parameters by mode name for mlock */ std::vector<ChanAccess *> access; /* List of authorized users */ std::vector<AutoKick *> akick; /* List of users to kickban */ - std::vector<BadWord *> badwords; /* List of badwords */ - std::bitset<128> mlock_on; /* Modes mlocked on */ - std::bitset<128> mlock_off; /* Modes mlocked off */ + std::vector<BadWord *> badwords; /* List of badwords */ + Flags<ChannelModeName> mlock_on; /* Modes mlocked on */ + Flags<ChannelModeName> mlock_off; /* Modes mlocked off */ public: /** Default constructor diff --git a/include/users.h b/include/users.h index 3937e2ebe..135e115ef 100644 --- a/include/users.h +++ b/include/users.h @@ -36,7 +36,7 @@ class CoreExport User : public Extensible std::string ident; std::string uid; bool OnAccess; /* If the user is on the access list of the nick theyre on */ - std::bitset<128> modes; /* Bitset of mode names the user has set on them */ + Flags<UserModeName> modes; /* Bitset of mode names the user has set on them */ std::map<UserModeName, std::string> Params; /* Map of user modes and the params this user has */ NickCore *nc; /* NickCore account the user is currently loggged in as */ @@ -254,9 +254,9 @@ class CoreExport User : public Extensible /** Set a string of modes on a user * @param bi The client setting the mode - * @param modes The modes + * @param umodes The modes */ - void SetModes(BotInfo *bi, const char *modes, ...); + void SetModes(BotInfo *bi, const char *umodes, ...); /** Find the channel container for Channel c that the user is on * This is preferred over using FindUser in Channel, as there are usually more users in a channel |
