From abfc9926dbe0b9dd00c060a9e4ebcc53e60e6709 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 29 Jul 2010 23:08:47 -0400 Subject: [PATCH] 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 --- include/channels.h | 6 +++--- include/extern.h | 4 ++-- include/modes.h | 2 +- include/operserv.h | 4 ++-- include/regchannel.h | 4 ++-- include/users.h | 4 ++-- modules/protocol/inspircd20.cpp | 2 ++ src/channels.cpp | 2 +- src/modes.cpp | 6 +++--- 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 *Status; + Flags *Status; UserContainer(User *u) : user(u) { } virtual ~UserContainer() { } @@ -60,7 +60,7 @@ enum ChannelFlags CH_SYNCING }; -class CoreExport Channel : public Extensible, public Flags +class CoreExport Channel : public Extensible, public Flags { private: /** A map of channel modes with their parameters set on this channel @@ -68,7 +68,7 @@ class CoreExport Channel : public Extensible, public Flags Params; /* Modes set on the channel */ - Flags modes; + Flags 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 DefMLockOn; -E Flags 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/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 News; extern CoreExport std::vector > DefCon; extern CoreExport bool DefConModesSet; -extern CoreExport Flags DefConModesOn; -extern CoreExport Flags DefConModesOff; +extern CoreExport Flags DefConModesOn; +extern CoreExport Flags DefConModesOff; extern CoreExport std::map 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 access; /* List of authorized users */ std::vector akick; /* List of users to kickban */ std::vector badwords; /* List of badwords */ - Flags mlock_on; /* Modes mlocked on */ - Flags mlock_off; /* Modes mlocked off */ + 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 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 *Status; + Flags *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 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 */ 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 *Status = new Flags; + Flags *Status = new Flags; 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 ModeManager::ChannelModesByName; /* Number of generic modes we support */ unsigned GenericChannelModes = 0, GenericUserModes = 0; /* Default mlocked modes on */ -Flags DefMLockOn; +Flags DefMLockOn; /* Default mlocked modes off */ -Flags DefMLockOff; +Flags DefMLockOff; /* Map for default mlocked mode parameters */ std::map DefMLockParams; /* Modes to set on bots when they join the channel */ @@ -43,7 +43,7 @@ void SetDefaultMLock() DefMLockOn.ClearFlags(); DefMLockOff.ClearFlags(); DefMLockParams.clear(); - Flags *ptr = NULL; + Flags *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 News; std::vector > DefCon; bool DefConModesSet = false; /* Defcon modes mlocked on */ -Flags DefConModesOn; +Flags DefConModesOn; /* Defcon modes mlocked off */ -Flags DefConModesOff; +Flags DefConModesOff; /* Map of Modesa and Params for DefCon */ std::map DefConModesOnParams;