diff options
| author | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-11-08 20:06:21 +0000 |
|---|---|---|
| committer | Adam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864> | 2009-11-08 20:06:21 +0000 |
| commit | 458be36a321615c0f3004a6abde7e14d40f5da32 (patch) | |
| tree | 711be83fc6f2d49f9d31015db51730cdac57f687 /include | |
| parent | 38ad96c57c520dd84c8de21766f5de082a844a99 (diff) | |
Rewrote all of the old C style flag systems into a new Flag class which everything inherits from. This breaks reading and writing flags to the old databases (and probably many other things aswell) - Don't use it
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2636 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
| -rw-r--r-- | include/account.h | 69 | ||||
| -rw-r--r-- | include/bots.h | 26 | ||||
| -rw-r--r-- | include/extern.h | 15 | ||||
| -rw-r--r-- | include/modules.h | 21 | ||||
| -rw-r--r-- | include/regchannel.h | 49 | ||||
| -rw-r--r-- | include/services.h | 412 |
6 files changed, 360 insertions, 232 deletions
diff --git a/include/account.h b/include/account.h index 09db33955..075b15e9e 100644 --- a/include/account.h +++ b/include/account.h @@ -1,6 +1,69 @@ /* NickServ nickname structures. */ +/** Flags set on NickAliases + */ +enum NickNameFlag +{ + NS_BEGIN, + + /* Nick may not be registered or used */ + NS_FORBIDDEN, + /* Nick never expires */ + NS_NO_EXPIRE, + /* Nick is being held after a kill */ + NS_KILL_HELD, + /* SVSNICK has been sent but nick has not yet changed. + * An enforcer will be introduced when it does change. */ + NS_GUESTED, + + NS_END +}; + +/** Flags set on NickCores + */ +enum NickCoreFlag +{ + NI_BEGIN, + + /* Kill others who take this nick */ + NI_KILLPROTECT, + /* Dont recognize unless IDENTIFIED */ + NI_SECURE, + /* Use PRIVMSG instead of NOTICE */ + NI_MSG, + /* Don't allow user to change memo limit */ + NI_MEMO_HARDMAX, + /* Notify of memos at signon and un-away */ + NI_MEMO_SIGNON, + /* Notify of new memos when sent */ + NI_MEMO_RECEIVE, + /* Don't show in LIST to non-servadmins */ + NI_PRIVATE, + /* Don't show email in INFO */ + NI_HIDE_EMAIL, + /* Don't show last seen address in INFO */ + NI_HIDE_MASK, + /* Don't show last quit message in INFO */ + NI_HIDE_QUIT, + /* Kill in 20 seconds instead of in 60 */ + NI_KILL_QUICK, + /* Kill immediatly */ + NI_KILL_IMMED, + /* User gets email on memo */ + NI_MEMO_MAIL, + /* Don't show services access status */ + NI_HIDE_STATUS, + /* Nickname is suspended */ + NI_SUSPENDED, + /* Autoop nickname in channels */ + NI_AUTOOP, + /* Nick won't expire */ + NI_NOEXPIRE, + + NI_END +}; + /** XXX: this really needs to die with fire and be merged with metadata into NickCore or something. */ class NickRequest @@ -24,7 +87,7 @@ class NickRequest class NickCore; -class CoreExport NickAlias : public Extensible +class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag> { public: NickAlias(); @@ -36,11 +99,10 @@ class CoreExport NickAlias : public Extensible char *last_usermask; /* Last usermask */ time_t time_registered; /* When the nick was registered */ time_t last_seen; /* When it was seen online for the last time */ - uint16 status; /* See NS_* below */ NickCore *nc; /* I'm an alias of this */ }; -class CoreExport NickCore : public Extensible +class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag> { public: NickCore(); @@ -53,7 +115,6 @@ class CoreExport NickCore : public Extensible char *greet; /* Greet associated to the nick */ uint32 icq; /* ICQ # associated to the nick */ char *url; /* URL associated to the nick */ - uint32 flags; /* See NI_* below */ uint16 language; /* Language selected by nickname owner (LANG_*) */ std::vector<std::string> access; /* Access list, vector of strings */ MemoInfo memos; diff --git a/include/bots.h b/include/bots.h index 38ad5534d..80ac08c1f 100644 --- a/include/bots.h +++ b/include/bots.h @@ -9,10 +9,33 @@ * */ +/** Flags settable on a bot + */ +enum BotFlag +{ + BI_BEGIN, + + /* This bot can only be assigned by IRCops */ + BI_PRIVATE, + /* The following flags are used to determin what bot really is what. + * Since you *could* have ChanServ really named BotServ or something stupid, + * this keeps track of them and allows them to be renamed in the config + * at any time, even if they already exist in the database + */ + BI_CHANSERV, + BI_BOTSERV, + BI_HOSTSERV, + BI_OPERSERV, + BI_MEMOSERV, + BI_NICKSERV, + BI_GLOBAL, + + BI_END +}; struct CommandHash; -class CoreExport BotInfo +class CoreExport BotInfo : public Extensible, public Flags<BotFlag> { public: BotInfo *next, *prev; @@ -22,7 +45,6 @@ class CoreExport BotInfo char *user; /* Its user name */ char *host; /* Its hostname */ char *real; /* Its real name */ - int16 flags; /* Bot flags -- see BI_* below */ time_t created; /* Birth date ;) */ int16 chancount; /* Number of channels that use the bot. */ /* Dynamic data */ diff --git a/include/extern.h b/include/extern.h index 821bc2190..21a4987ff 100644 --- a/include/extern.h +++ b/include/extern.h @@ -123,7 +123,7 @@ E Entry *elist_find_mask(EList *list, const char *mask); E long get_memuse(EList *list); -#define whosends(ci) ((!(ci) || !((ci)->botflags & BS_SYMBIOSIS) || !(ci)->bi || !(ci)->c || (ci)->c->usercount < BSMinUsers) ? findbot(s_ChanServ) : (ci)->bi) +#define whosends(ci) ((!(ci) || !((ci)->botflags.HasFlag(BS_SYMBIOSIS)) || !(ci)->bi || !(ci)->c || (ci)->c->usercount < BSMinUsers) ? findbot(s_ChanServ) : (ci)->bi) /**** chanserv.c ****/ @@ -257,7 +257,7 @@ E bool RestrictMail; E time_t MailDelay; E bool DontQuoteAddresses; -E int NSDefFlags; +E Flags<NickCoreFlag> NSDefFlags; E unsigned NSDefLanguage; E time_t NSRegDelay; E time_t NSResendDelay; @@ -280,7 +280,7 @@ E bool NSEmailReg; E bool NSModeOnID; E bool NSAddAccessOnReg; -E int CSDefFlags; +E Flags<ChannelInfoFlag> CSDefFlags; E unsigned CSMaxReg; E time_t CSExpire; E int CSDefBantype; @@ -298,7 +298,7 @@ E time_t MSSendDelay; E bool MSNotifyAll; E unsigned MSMemoReceipt; -E int BSDefFlags; +E Flags<BotServFlag> BSDefFlags; E time_t BSKeepData; E unsigned BSMinUsers; E unsigned BSBadWordsMax; @@ -720,14 +720,13 @@ E Server *serv_uplink; E uint32 uplink_capab; E CapabInfo capab_info[]; -E Server *first_server(int flags); -E Server *next_server(int flags); +E Server *first_server(ServerFlag flag); +E Server *next_server(ServerFlag flag); E int is_ulined(const char *server); E int is_sync(Server *server); -E Server *new_server(Server * uplink, const char *name, const char *desc, - uint16 flags, const char *suid); +E Server *new_server(Server * uplink, const char *name, const char *desc, ServerFlag flag, const char *suid); E Server *findserver(Server *s, const char *name); diff --git a/include/modules.h b/include/modules.h index bd128a3bc..d5fddcc44 100644 --- a/include/modules.h +++ b/include/modules.h @@ -217,7 +217,7 @@ struct ModuleLang_ { char **argv; }; -enum CommandFlags +enum CommandFlag { CFLAG_ALLOW_UNREGISTERED = 1, CFLAG_ALLOW_FORBIDDEN = 2, @@ -229,9 +229,8 @@ enum CommandFlags /** Every services command is a class, inheriting from Command. */ -class CoreExport Command +class CoreExport Command : public Flags<CommandFlag> { - int flags; public: size_t MaxParams; size_t MinParams; @@ -264,22 +263,6 @@ class CoreExport Command */ virtual void OnSyntaxError(User *u); - /** Set a certain flag on this command. - * @param flag The CommandFlag to set on this command. - */ - void SetFlag(CommandFlags flag); - - /** Remove a certain flag from this command. - * @param flag The CommandFlag to unset. - */ - void UnsetFlag(CommandFlags flag); - - /** Check whether a certain flag is set on this command. - * @param flag The CommandFlag to check. - * @return bool True if the flag is set, false else. - */ - bool HasFlag(CommandFlags flag) const; - /** Set which command permission (e.g. chanserv/forbid) is required for this command. * @param reststr The permission required to successfully execute this command */ diff --git a/include/regchannel.h b/include/regchannel.h index 73a0666ab..710437374 100644 --- a/include/regchannel.h +++ b/include/regchannel.h @@ -9,7 +9,51 @@ * */ -class CoreExport ChannelInfo : public Extensible +/** Flags used for the ChannelInfo class + */ +enum ChannelInfoFlag +{ + CI_BEGIN, + + /* ChanServ is currently holding the channel */ + CI_INHABIT, + /* Retain the topic even after the channel is emptied */ + CI_KEEPTOPIC, + /* Don't allow non-authorized users to be opped */ + CI_SECUREOPS, + /* Hide channel from ChanServ LIST command */ + CI_PRIVATE, + /* Topic can only be changed by SET TOPIC */ + CI_TOPICLOCK, + /* Only users on the access list may join */ + CI_RESTRICTED, + /* Don't allow ChanServ and BotServ commands to do bad things to users with higher access levels */ + CI_PEACE, + /* Don't allow any privileges unless a user is IDENTIFIED with NickServ */ + CI_SECURE, + /* Don't allow the channel to be registered or used */ + CI_FORBIDDEN, + /* Channel does not expire */ + CI_NO_EXPIRE, + /* Channel memo limit may not be changed */ + CI_MEMO_HARDMAX, + /* Send notice to channel on use of OP/DEOP */ + CI_OPNOTICE, + /* Stricter control of channel founder status */ + CI_SECUREFOUNDER, + /* Sign kicks with the user who did the kick */ + CI_SIGNKICK, + /* Sign kicks if level is < than the one defined by the SIGNKIGK level */ + CI_SIGNKICK_LEVEL, + /* Uses XOP */ + CI_XOP, + /* Channel is suspended */ + CI_SUSPENDED, + + CI_END +}; + +class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag> { private: std::map<ChannelModeName, std::string> Params; /* Map of parameters by mode name */ @@ -36,7 +80,6 @@ class CoreExport ChannelInfo : public Extensible char last_topic_setter[NICKMAX]; /* Who set the last topic */ time_t last_topic_time; /* When the last topic was set */ - uint32 flags; /* See below */ char *forbidby; char *forbidreason; @@ -53,7 +96,7 @@ class CoreExport ChannelInfo : public Extensible /* For BotServ */ BotInfo *bi; /* Bot used on this channel */ - uint32 botflags; /* BS_* below */ + Flags<BotServFlag> botflags; int16 *ttb; /* Times to ban for each kicker */ uint16 bwcount; diff --git a/include/services.h b/include/services.h index 738c4b283..1680d4d1a 100644 --- a/include/services.h +++ b/include/services.h @@ -418,18 +418,65 @@ class CoreExport Extensible }; +/** Class with the ability to keep flags on items, they should extend from this + * where T is an enum. + */ +template <class T> +class CoreExport Flags +{ + protected: + std::bitset<128> Flag_Values; + + public: + /** Add a flag to this item + * @param Value The flag + */ + void SetFlag(T Value) + { + Flag_Values[(size_t)Value] = true; + } + + /** Remove a flag from this item + * @param Value The flag + */ + void UnsetFlag(T Value) + { + Flag_Values[(size_t)Value] = false; + } + + /** Check if this item has a flag + * @param Value The flag + * @return true or false + */ + const bool HasFlag(T Value) const + { + return Flag_Values[(size_t)Value]; + } + + /** Check how many flags are set + * @return The number of flags set + */ + const size_t FlagCount() const + { + return Flag_Values.count(); + } + + /** Unset all of the flags + */ + void ClearFlags() + { + Flag_Values.reset(); + } +}; + /*************************************************************************/ /* forward declarations, mostly used by older code */ class User; class ChannelInfo; class Channel; +class EList; -typedef struct server_ Server; -typedef struct c_elist EList; -typedef struct c_elist_entry Entry; -typedef struct memo_ Memo; -typedef struct badword_ BadWord; typedef struct bandata_ BanData; typedef struct userdata_ UserData; typedef struct mailinfo_ MailInfo; @@ -584,12 +631,24 @@ struct ircdcapab_ { /*************************************************************************/ +/** Memo Flags + */ +enum MemoFlag +{ + /* Memo is unread */ + MF_UNREAD, + /* SEnder requests a receipt */ + MF_RECEIPT, + /* Memo is a notification of receipt */ + MF_NOTIFYS +}; + /* Memo info structures. Since both nicknames and channels can have memos, * we encapsulate memo data in a MemoList to make it easier to handle. */ - -struct memo_ { +class CoreExport Memo : public Flags<MemoFlag> +{ + public: uint32 number; /* Index number -- not necessarily array position! */ - uint16 flags; time_t time; /* When it was sent */ char sender[NICKMAX]; char *text; @@ -636,7 +695,8 @@ enum AccessLevel * wouldn't get very far. ;) ) */ /* Access levels for users. */ -struct ChanAccess { +struct ChanAccess +{ uint16 in_use; /* 1 if this entry is in use, else 0 */ int16 level; NickCore *nc; /* Guaranteed to be non-NULL if in use, NULL if not */ @@ -644,11 +704,22 @@ struct ChanAccess { std::string creator; }; -/* AutoKick data. */ -struct AutoKick +/** Flags for auto kick + */ +enum AutoKickFlag { - uint16 flags; + /* This auto kick entry is in use */ + AK_USED, + /* Is by nick core, not mask */ + AK_ISNICK, + /* This entry is stuck */ + AK_STUCK +}; +/* AutoKick data. */ +class CoreExport AutoKick : public Flags<AutoKickFlag> +{ + public: /* Only one of these can be in use */ std::string mask; NickCore *nc; @@ -658,63 +729,28 @@ struct AutoKick time_t addtime; }; -#define AK_USED 0x0001 -#define AK_ISNICK 0x0002 -#define AK_STUCK 0x0004 +/** Flags for badwords + */ +enum BadWordType +{ + /* Always kicks if the word is said */ + BW_ANY, + /* User must way the entire word */ + BW_SINGLE, + /* The word has to start with the badword */ + BW_START, + /* The word has to end with the badword */ + BW_END +}; /* Structure used to contain bad words. */ - -struct badword_ { +struct BadWord +{ uint16 in_use; char *word; - uint16 type; /* BW_* below */ + BadWordType type; }; -#define BW_ANY 0 -#define BW_SINGLE 1 -#define BW_START 2 -#define BW_END 3 - -#include "regchannel.h" - -/* Retain topic even after last person leaves channel */ -#define CI_KEEPTOPIC 0x00000001 -/* Don't allow non-authorized users to be opped */ -#define CI_SECUREOPS 0x00000002 -/* Hide channel from ChanServ LIST command */ -#define CI_PRIVATE 0x00000004 -/* Topic can only be changed by SET TOPIC */ -#define CI_TOPICLOCK 0x00000008 -/* Those not allowed ops are kickbanned */ -#define CI_RESTRICTED 0x00000010 -/* Don't allow ChanServ and BotServ commands to do bad things to bigger levels */ -#define CI_PEACE 0x00000020 -/* Don't allow any privileges unless a user is IDENTIFY'd with NickServ */ -#define CI_SECURE 0x00000040 -/* Don't allow the channel to be registered or used */ -#define CI_FORBIDDEN 0x00000080 -/* Channel password is encrypted */ -#define CI_ENCRYPTEDPW 0x00000100 -/* Channel does not expire */ -#define CI_NO_EXPIRE 0x00000200 -/* Channel memo limit may not be changed */ -#define CI_MEMO_HARDMAX 0x00000400 -/* Send notice to channel on use of OP/DEOP */ -#define CI_OPNOTICE 0x00000800 -/* Stricter control of channel founder status */ -#define CI_SECUREFOUNDER 0x00001000 -/* Always sign kicks */ -#define CI_SIGNKICK 0x00002000 -/* Sign kicks if level is < than the one defined by the SIGNKICK level */ -#define CI_SIGNKICK_LEVEL 0x00004000 -/* Use the xOP lists */ -#define CI_XOP 0x00008000 -/* Channel is suspended */ -#define CI_SUSPENDED 0x00010000 - -/* TEMPORARY - ChanServ is on the channel. */ -#define CI_INHABIT 0x80000000 - /* Indices for cmd_access[]: */ #define CA_INVITE 0 #define CA_AKICK 1 @@ -759,22 +795,37 @@ struct badword_ { #define CA_SIZE 39 /* BotServ SET flags */ -#define BS_DONTKICKOPS 0x00000001 -#define BS_DONTKICKVOICES 0x00000002 -#define BS_FANTASY 0x00000004 -#define BS_SYMBIOSIS 0x00000008 -#define BS_GREET 0x00000010 -#define BS_NOBOT 0x00000020 - -/* BotServ Kickers flags */ -#define BS_KICK_BOLDS 0x80000000 -#define BS_KICK_COLORS 0x40000000 -#define BS_KICK_REVERSES 0x20000000 -#define BS_KICK_UNDERLINES 0x10000000 -#define BS_KICK_BADWORDS 0x08000000 -#define BS_KICK_CAPS 0x04000000 -#define BS_KICK_FLOOD 0x02000000 -#define BS_KICK_REPEAT 0x01000000 +enum BotServFlag +{ + /* BotServ won't kick ops */ + BS_DONTKICKOPS, + /* BotServ won't kick voices */ + BS_DONTKICKVOICES, + /* BotServ bot accepts fantasy commands */ + BS_FANTASY, + /* BotServ bot sets modes etc instead of ChanServ */ + BS_SYMBIOSIS, + /* BotServ should show greets */ + BS_GREET, + /* BotServ bots are not allowed to be in this channel */ + BS_NOBOT, + /* BotServ kicks for bolds */ + BS_KICK_BOLDS, + /* BotServ kicks for colors */ + BS_KICK_COLORS, + /* BOtServ kicks for reverses */ + BS_KICK_REVERSES, + /* BotServ kicks for underlines */ + BS_KICK_UNDERLINES, + /* BotServ kicks for badwords */ + BS_KICK_BADWORDS, + /* BotServ kicks for caps */ + BS_KICK_CAPS, + /* BotServ kicks for flood */ + BS_KICK_FLOOD, + /* BotServ kicks for repeating */ + BS_KICK_REPEAT +}; /* Indices for TTB (Times To Ban) */ #define TTB_BOLDS 0 @@ -787,6 +838,8 @@ struct badword_ { #define TTB_REPEAT 7 #define TTB_SIZE 8 +#include "regchannel.h" + /*************************************************************************/ typedef struct { @@ -805,13 +858,30 @@ typedef enum { SSYNC_DONE = 1 /* We're in sync */ } SyncState; -struct server_ { +/** Flags set on servers + */ +enum ServerFlag +{ + SERVER_START, + + /* This server is me */ + SERVER_ISME, + /* This server was juped */ + SERVER_JUPED, + /* This server is the current uplink */ + SERVER_ISUPLINK, + + SERVER_END +}; + +class CoreExport Server : public Flags<ServerFlag> +{ + public: Server *next, *prev; char *name; /* Server name */ uint16 hops; /* Hops between services and server */ char *desc; /* Server description */ - uint16 flags; /* Some info flags, as defined below */ char *suid; /* Server Univeral ID */ SyncState sync; /* Server sync state (see above) */ @@ -819,10 +889,6 @@ struct server_ { Server *uplink; /* Server which pretends to be the uplink */ }; -#define SERVER_ISME 0x0001 -#define SERVER_JUPED 0x0002 -#define SERVER_ISUPLINK 0x0004 - /*************************************************************************/ #define CUS_OP 0x0001 @@ -866,16 +932,6 @@ struct userdata_ { int16 times; }; -/* Channelban type flags */ -#define ENTRYTYPE_NONE 0x00000000 -#define ENTRYTYPE_CIDR4 0x00000001 -#define ENTRYTYPE_NICK_WILD 0x00000004 -#define ENTRYTYPE_NICK 0x00000008 -#define ENTRYTYPE_USER_WILD 0x00000010 -#define ENTRYTYPE_USER 0x00000020 -#define ENTRYTYPE_HOST_WILD 0x00000040 -#define ENTRYTYPE_HOST 0x00000080 - struct c_userlist { struct c_userlist *next, *prev; User *user; @@ -998,19 +1054,35 @@ class CoreExport Channel : public Extensible const bool HasParam(ChannelModeName Name); }; -struct c_elist { - Entry *entries; - int32 count; +/** Channelban type flags + */ +enum EntryType +{ + ENTRYTYPE_NONE, + ENTRYTYPE_CIDR4, + ENTRYTYPE_NICK_WILD, + ENTRYTYPE_NICK, + ENTRYTYPE_USER_WILD, + ENTRYTYPE_USER, + ENTRYTYPE_HOST_WILD, + ENTRYTYPE_HOST }; -struct c_elist_entry { +class CoreExport Entry : public Flags<EntryType> +{ + public: Entry *next, *prev; - uint32 type; uint32 cidr_ip; /* IP mask for CIDR matching */ uint32 cidr_mask; /* Netmask for CIDR matching */ char *nick, *user, *host, *mask; }; +struct EList +{ + Entry *entries; + int32 count; +}; + /*************************************************************************/ /* Ignorance list data. */ @@ -1469,62 +1541,10 @@ enum DefconLevel DEFCON_SILENT_OPER_ONLY, DEFCON_AKILL_NEW_CLIENTS, DEFCON_NO_NEW_MEMOS - }; /*************************************************************************/ -/* Memo Flags */ -#define MF_UNREAD 0x0001 /* Memo has not yet been read */ -#define MF_RECEIPT 0x0002 /* Sender requested receipt */ -#define MF_NOTIFYS 0x0004 /* Memo is a notification of receitp */ - -/* Nickname status flags: */ -#define NS_FORBIDDEN 0x0002 /* Nick may not be registered or used */ -#define NS_NO_EXPIRE 0x0004 /* Nick never expires */ -//#define NS_IDENTIFIED 0x8000 /* User has IDENTIFY'd */ -//#define NS_RECOGNIZED 0x4000 /* ON_ACCESS true && SECURE flag not set */ -//#define NS_ON_ACCESS 0x2000 /* User comes from a known address */ -#define NS_KILL_HELD 0x1000 /* Nick is being held after a kill */ -#define NS_GUESTED 0x0100 /* SVSNICK has been sent but nick has not - * yet changed. An enforcer will be - * introduced when it does change. */ -#define NS_MASTER 0x0200 /* Was a master nick; used to import old databases */ -#define NS_TRANSGROUP 0xC000 /* Status flags that can be passed to a nick of the - same group during nick change */ -#define NS_TEMPORARY 0xFF00 /* All temporary status flags */ -/* These two are not used anymore */ -#define NS_OLD_ENCRYPTEDPW 0x0001 /* Nickname password is encrypted */ - - - - -/* Nickname setting flags: */ -#define NI_KILLPROTECT 0x00000001 /* Kill others who take this nick */ -#define NI_SECURE 0x00000002 /* Don't recognize unless IDENTIFY'd */ -#define NI_MSG 0x00000004 /* Use PRIVMSGs instead of NOTICEs */ -#define NI_MEMO_HARDMAX 0x00000008 /* Don't allow user to change memo limit */ -#define NI_MEMO_SIGNON 0x00000010 /* Notify of memos at signon and un-away */ -#define NI_MEMO_RECEIVE 0x00000020 /* Notify of new memos when sent */ -#define NI_PRIVATE 0x00000040 /* Don't show in LIST to non-servadmins */ -#define NI_HIDE_EMAIL 0x00000080 /* Don't show E-mail in INFO */ -#define NI_HIDE_MASK 0x00000100 /* Don't show last seen address in INFO */ -#define NI_HIDE_QUIT 0x00000200 /* Don't show last quit message in INFO */ -#define NI_KILL_QUICK 0x00000400 /* Kill in 20 seconds instead of 60 */ -#define NI_KILL_IMMED 0x00000800 /* Kill immediately instead of in 60 sec */ -//#define NI_SERVICES_OPER 0x00001000 /* No longer used */ -//#define NI_SERVICES_ADMIN 0x00002000 /* No longer used */ -#define NI_ENCRYPTEDPW 0x00004000 /* Nickname password is encrypted */ -//#define NI_SERVICES_ROOT 0x00008000 /* No longer used */ -#define NI_MEMO_MAIL 0x00010000 /* User gets email on memo */ -#define NI_HIDE_STATUS 0x00020000 /* Don't show services access status */ -#define NI_SUSPENDED 0x00040000 /* Nickname is suspended */ -#define NI_AUTOOP 0x00080000 /* Autoop nickname in channels */ -#define NI_NOEXPIRE 0x00100000 /* nicks in this group won't expire */ - -// Old NS_FORBIDDEN, very fucking temporary. -#define NI_FORBIDDEN 0x80000000 - /* Languages. Never insert anything in the middle of this list, or * everybody will start getting the wrong language! If you want to change * the order the languages are displayed in for NickServ HELP SET LANGUAGE, @@ -1553,54 +1573,54 @@ enum DefconLevel #define DEF_LANGUAGE LANG_EN_US -#define BI_PRIVATE 0x0001 -#define BI_CHANSERV 0x0002 -#define BI_BOTSERV 0x0004 -#define BI_HOSTSERV 0x0008 -#define BI_OPERSERV 0x0010 -#define BI_MEMOSERV 0x0020 -#define BI_NICKSERV 0x0040 -#define BI_GLOBAL 0x0080 - /*************************************************************************/ -/* CAPAB stuffs */ -typedef struct capabinfo_ CapabInfo; -struct capabinfo_ { - const char *token; - uint32 flag; +/* Types of capab + */ +enum CapabType +{ + CAPAB_BEGIN, + + CAPAB_NOQUIT, + CAPAB_TSMODE, + CAPAB_UNCONNECT, + CAPAB_NICKIP, + CAPAB_NSJOIN, + CAPAB_ZIP, + CAPAB_BURST, + CAPAB_TS3, + CAPAB_TS5, + CAPAB_DKEY, + CAPAB_DOZIP, + CAPAB_DODKEY, + CAPAB_QS, + CAPAB_SCS, + CAPAB_PT4, + CAPAB_UID, + CAPAB_KNOCK, + CAPAB_CLIENT, + CAPAB_IPV6, + CAPAB_SSJ5, + CAPAB_SN2, + CAPAB_VHOST, + CAPAB_TOKEN, + CAPAB_SSJ3, + CAPAB_NICK2, + CAPAB_VL, + CAPAB_TLKEXT, + CAPAB_CHANMODE, + CAPAB_SJB64, + CAPAB_NICKCHARS, + + CAPAB_END }; -#define CAPAB_NOQUIT 0x00000001 -#define CAPAB_TSMODE 0x00000002 -#define CAPAB_UNCONNECT 0x00000004 -#define CAPAB_NICKIP 0x00000008 -#define CAPAB_NSJOIN 0x00000010 -#define CAPAB_ZIP 0x00000020 -#define CAPAB_BURST 0x00000040 -#define CAPAB_TS3 0x00000080 -#define CAPAB_TS5 0x00000100 -#define CAPAB_DKEY 0x00000200 -#define CAPAB_DOZIP 0x00000400 -#define CAPAB_DODKEY 0x00000800 -#define CAPAB_QS 0x00001000 -#define CAPAB_SCS 0x00002000 -#define CAPAB_PT4 0x00004000 -#define CAPAB_UID 0x00008000 -#define CAPAB_KNOCK 0x00010000 -#define CAPAB_CLIENT 0x00020000 -#define CAPAB_IPV6 0x00040000 -#define CAPAB_SSJ5 0x00080000 -#define CAPAB_SN2 0x00100000 -#define CAPAB_VHOST 0x00200000 -#define CAPAB_TOKEN 0x00400000 -#define CAPAB_SSJ3 0x00800000 -#define CAPAB_NICK2 0x01000000 -#define CAPAB_VL 0x02000000 -#define CAPAB_TLKEXT 0x04000000 -#define CAPAB_CHANMODE 0x08000000 -#define CAPAB_SJB64 0x10000000 -#define CAPAB_NICKCHARS 0x20000000 +/* CAPAB stuffs */ +struct CapabInfo +{ + const char *token; + CapabType flag; +}; /*************************************************************************/ |
