1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 19:14:47 +02:00

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

This commit is contained in:
Adam
2010-07-29 23:08:47 -04:00
parent cc64903179
commit abfc9926db
10 changed files with 20 additions and 18 deletions
+3 -3
View File
@@ -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
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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
};
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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
+2 -2
View File
@@ -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 */
+2
View File
@@ -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"))
+1 -1
View File
@@ -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);
+3 -3
View File
@@ -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);
+2 -2
View File
@@ -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;