From ee57f5719301c3883afcffe5970746f378960917 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 15 May 2010 00:56:52 -0400 Subject: Store modes in users and channels using the Flags class, cleaner --- include/channels.h | 4 ++-- include/extern.h | 4 ++-- include/regchannel.h | 6 +++--- include/users.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'include') 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 std::map Params; /* Modes set on the channel */ - std::bitset<128> modes; + Flags modes; public: /** Default constructor @@ -136,7 +136,7 @@ class CoreExport Channel : public Extensible, public Flags /** 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 DefMLockOn; +E Flags DefMLockOff; E std::map DefMLockParams; /* Modes to set on bots when they join the channel */ E std::list 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 std::map Params; /* Map of parameters by mode name for mlock */ std::vector access; /* List of authorized users */ std::vector akick; /* List of users to kickban */ - std::vector badwords; /* List of badwords */ - std::bitset<128> mlock_on; /* Modes mlocked on */ - std::bitset<128> mlock_off; /* Modes mlocked off */ + std::vector badwords; /* List of badwords */ + Flags mlock_on; /* Modes mlocked on */ + Flags 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 modes; /* Bitset of mode names the user has set on them */ std::map 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 -- cgit