diff options
author | Adam <Adam@anope.org> | 2010-07-29 23:08:47 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-07-29 23:08:47 -0400 |
commit | abfc9926dbe0b9dd00c060a9e4ebcc53e60e6709 (patch) | |
tree | bb919b5886391b2506f670d9fb0f82b4686e0cf5 | |
parent | cc649031792af1e94c7701decd708aba4091d708 (diff) |
Added support for tracking inspircd2.0 usermode +Q and cahnged the Flags bitsets for modes to not use a max defined value, it can go over
-rw-r--r-- | include/channels.h | 6 | ||||
-rw-r--r-- | include/extern.h | 4 | ||||
-rw-r--r-- | include/modes.h | 2 | ||||
-rw-r--r-- | include/operserv.h | 4 | ||||
-rw-r--r-- | include/regchannel.h | 4 | ||||
-rw-r--r-- | include/users.h | 4 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 2 | ||||
-rw-r--r-- | src/channels.cpp | 2 | ||||
-rw-r--r-- | src/modes.cpp | 6 | ||||
-rw-r--r-- | src/operserv.cpp | 4 |
10 files changed, 20 insertions, 18 deletions
diff --git a/include/channels.h b/include/channels.h index 56fa7cf46..845f8fc36 100644 --- a/include/channels.h +++ b/include/channels.h @@ -44,7 +44,7 @@ struct UserContainer { User *user; UserData ud; - Flags<ChannelModeName, CMODE_END> *Status; + Flags<ChannelModeName> *Status; UserContainer(User *u) : user(u) { } virtual ~UserContainer() { } @@ -60,7 +60,7 @@ enum ChannelFlags CH_SYNCING }; -class CoreExport Channel : public Extensible, public Flags<ChannelFlags, CMODE_END> +class CoreExport Channel : public Extensible, public Flags<ChannelFlags> { private: /** A map of channel modes with their parameters set on this channel @@ -68,7 +68,7 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags, CMODE_E std::map<ChannelModeName, Anope::string> Params; /* Modes set on the channel */ - Flags<ChannelModeName, CMODE_END> modes; + Flags<ChannelModeName> modes; public: /** Default constructor diff --git a/include/extern.h b/include/extern.h index 7d625ec91..e4a87d1d2 100644 --- a/include/extern.h +++ b/include/extern.h @@ -299,8 +299,8 @@ E int str_is_cidr(const Anope::string &str, uint32 *ip, uint32 *mask, Anope::str /**** modes.cpp ****/ /* Number of generic modes we support */ E unsigned GenericChannelModes, GenericUserModes; -E Flags<ChannelModeName, CMODE_END> DefMLockOn; -E Flags<ChannelModeName, CMODE_END> DefMLockOff; +E Flags<ChannelModeName> DefMLockOn; +E Flags<ChannelModeName> DefMLockOff; E std::map<ChannelModeName, Anope::string> DefMLockParams; /* Modes to set on bots when they join the channel */ E std::list<ChannelModeStatus *> BotModes; diff --git a/include/modes.h b/include/modes.h index 7a4ff7f70..6447550ad 100644 --- a/include/modes.h +++ b/include/modes.h @@ -19,7 +19,7 @@ enum UserModeName UMODE_REGPRIV, UMODE_PROTECTED, UMODE_NO_CTCP, UMODE_WEBTV, UMODE_WHOIS, UMODE_ADMIN, UMODE_DEAF, UMODE_GLOBOPS, UMODE_HELPOP, UMODE_INVIS, UMODE_OPER, UMODE_PRIV, UMODE_GOD, UMODE_REGISTERED, UMODE_SNOMASK, UMODE_VHOST, UMODE_WALLOPS, UMODE_CLOAK, UMODE_SSL, UMODE_CALLERID, UMODE_COMMONCHANS, - UMODE_HIDDEN, UMODE_STRIPCOLOR, + UMODE_HIDDEN, UMODE_STRIPCOLOR, UMODE_INVISIBLE_OPER, UMODE_END }; diff --git a/include/operserv.h b/include/operserv.h index e3c25b0f6..d1c03c481 100644 --- a/include/operserv.h +++ b/include/operserv.h @@ -12,8 +12,8 @@ extern CoreExport std::vector<NewsItem *> News; extern CoreExport std::vector<std::bitset<32> > DefCon; extern CoreExport bool DefConModesSet; -extern CoreExport Flags<ChannelModeName, CMODE_END> DefConModesOn; -extern CoreExport Flags<ChannelModeName, CMODE_END> DefConModesOff; +extern CoreExport Flags<ChannelModeName> DefConModesOn; +extern CoreExport Flags<ChannelModeName> DefConModesOff; extern CoreExport std::map<ChannelModeName, Anope::string> DefConModesOnParams; class XLineManager; diff --git a/include/regchannel.h b/include/regchannel.h index 178b3c32d..e19b07f5e 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -69,8 +69,8 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag, std::vector<ChanAccess *> access; /* List of authorized users */ std::vector<AutoKick *> akick; /* List of users to kickban */ std::vector<BadWord *> badwords; /* List of badwords */ - Flags<ChannelModeName, CMODE_END> mlock_on; /* Modes mlocked on */ - Flags<ChannelModeName, CMODE_END> mlock_off; /* Modes mlocked off */ + 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 8f82981c5..f545c15a1 100644 --- a/include/users.h +++ b/include/users.h @@ -20,7 +20,7 @@ extern CoreExport user_uid_map UserListByUID; struct ChannelContainer { Channel *chan; - Flags<ChannelModeName, CMODE_END> *Status; + Flags<ChannelModeName> *Status; ChannelContainer(Channel *c) : chan(c) { } virtual ~ChannelContainer() { } @@ -36,7 +36,7 @@ class CoreExport User : public Extensible Anope::string ident; Anope::string uid; bool OnAccess; /* If the user is on the access list of the nick theyre on */ - Flags<UserModeName, UMODE_END> 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, Anope::string> Params; /* Map of user modes and the params this user has */ NickCore *nc; /* NickCore account the user is currently loggged in as */ diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 6ca1727c6..776ec00d4 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -1030,6 +1030,8 @@ int anope_event_capab(const Anope::string &source, int ac, const char **av) um = new UserMode(UMODE_HIDEOPER, "UMODE_HIDEOPER", modechar[0]); else if (modename.equals_cs("invisible")) um = new UserMode(UMODE_INVIS, "UMODE_INVIS", modechar[0]); + else if (modename.equals_cs("invis-oper")) + um = new UserMode(UMODE_INVISIBLE_OPER, "UMODE_INVISIBLE_OPER", modechar[0]); else if (modename.equals_cs("oper")) um = new UserMode(UMODE_OPER, "UMODE_OPER", modechar[0]); else if (modename.equals_cs("regdeaf")) diff --git a/src/channels.cpp b/src/channels.cpp index 0d034f222..525478ea1 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -91,7 +91,7 @@ void Channel::JoinUser(User *user) { Alog(LOG_DEBUG) << user->nick << " joins " << this->name; - Flags<ChannelModeName, CMODE_END> *Status = new Flags<ChannelModeName, CMODE_END>; + Flags<ChannelModeName> *Status = new Flags<ChannelModeName>; ChannelContainer *cc = new ChannelContainer(this); cc->Status = Status; user->chans.push_back(cc); diff --git a/src/modes.cpp b/src/modes.cpp index 6d8fca77e..6279eb144 100644 --- a/src/modes.cpp +++ b/src/modes.cpp @@ -28,9 +28,9 @@ std::map<ChannelModeName, ChannelMode *> ModeManager::ChannelModesByName; /* Number of generic modes we support */ unsigned GenericChannelModes = 0, GenericUserModes = 0; /* Default mlocked modes on */ -Flags<ChannelModeName, CMODE_END> DefMLockOn; +Flags<ChannelModeName> DefMLockOn; /* Default mlocked modes off */ -Flags<ChannelModeName, CMODE_END> DefMLockOff; +Flags<ChannelModeName> DefMLockOff; /* Map for default mlocked mode parameters */ std::map<ChannelModeName, Anope::string> DefMLockParams; /* Modes to set on bots when they join the channel */ @@ -43,7 +43,7 @@ void SetDefaultMLock() DefMLockOn.ClearFlags(); DefMLockOff.ClearFlags(); DefMLockParams.clear(); - Flags<ChannelModeName, CMODE_END> *ptr = NULL; + Flags<ChannelModeName> *ptr = NULL; Anope::string modes, param; spacesepstream sep(Config.MLock); diff --git a/src/operserv.cpp b/src/operserv.cpp index 51f77f6b1..373710d26 100644 --- a/src/operserv.cpp +++ b/src/operserv.cpp @@ -18,9 +18,9 @@ std::vector<NewsItem *> News; std::vector<std::bitset<32> > DefCon; bool DefConModesSet = false; /* Defcon modes mlocked on */ -Flags<ChannelModeName, CMODE_END> DefConModesOn; +Flags<ChannelModeName> DefConModesOn; /* Defcon modes mlocked off */ -Flags<ChannelModeName, CMODE_END> DefConModesOff; +Flags<ChannelModeName> DefConModesOff; /* Map of Modesa and Params for DefCon */ std::map<ChannelModeName, Anope::string> DefConModesOnParams; |