summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-15 17:55:55 +0000
committerrburchell <rburchell@5417fbe8-f217-4b02-8779-1006273d7864>2008-11-15 17:55:55 +0000
commitb2b0e1d235686ff8389d2930a53366abefd1bb9d (patch)
tree262a47642e64f91d8a240dad7d281cd205e13b50 /include
parent5384c97c141c9b3acfecb154b8bd41e57f706e00 (diff)
Create and use constructors for NickInfo, NickAlias, ChannelInfo. Inherit all three from Extensible. Convert to use that instead of moduleData stuff.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1705 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
-rw-r--r--include/account.h24
-rw-r--r--include/services.h60
2 files changed, 23 insertions, 61 deletions
diff --git a/include/account.h b/include/account.h
index 13d3ca517..7ddc89e8e 100644
--- a/include/account.h
+++ b/include/account.h
@@ -20,6 +20,16 @@ class NickCore;
class NickAlias
{
public:
+ NickAlias()
+ {
+ next = prev = NULL;
+ nick = last_quit = last_realname = last_usermask = NULL;
+ time_registered = last_seen = 0;
+ status = 0;
+ nc = NULL;
+ u = NULL;
+ }
+
NickAlias *next, *prev;
char *nick; /* Nickname */
char *last_quit; /* Last quit message */
@@ -31,13 +41,22 @@ class NickAlias
NickCore *nc; /* I'm an alias of this */
/* Not saved */
- ModuleData *moduleData; /* Module saved data attached to the nick alias */
User *u; /* Current online user that has me */
};
-class NickCore
+class NickCore : public Extensible
{
public:
+ NickCore()
+ {
+ next = prev = NULL;
+ display = email = greet = url = NULL;
+ pass[0] = '\0';
+ icq = flags = 0;
+ language = accesscount = channelcount = 0;
+ lastmail = 0;
+ }
+
NickCore *next, *prev;
char *display; /* How the nick is displayed */
@@ -54,7 +73,6 @@ class NickCore
uint16 channelcount; /* Number of channels currently registered */
/* Unsaved data */
- ModuleData *moduleData; /* Module saved data attached to the NickCore */
time_t lastmail; /* Last time this nick record got a mail */
SList aliases; /* List of aliases */
};
diff --git a/include/services.h b/include/services.h
index 7b9c87471..d6cdc015b 100644
--- a/include/services.h
+++ b/include/services.h
@@ -384,6 +384,7 @@ class Extensible
/* forward declarations, mostly used by older code */
class User;
+class ChannelInfo;
typedef struct server_ Server;
@@ -392,7 +393,6 @@ typedef struct c_elist EList;
typedef struct c_elist_entry Entry;
typedef struct ModuleData_ ModuleData; /* ModuleData struct */
typedef struct memo_ Memo;
-typedef struct chaninfo_ ChannelInfo;
typedef struct badword_ BadWord;
typedef struct bandata_ BanData;
typedef struct userdata_ UserData;
@@ -689,63 +689,7 @@ struct badword_ {
#define BW_START 2
#define BW_END 3
-
-struct chaninfo_ {
- ChannelInfo *next, *prev;
- char name[CHANMAX];
- NickCore *founder;
- NickCore *successor; /* Who gets the channel if the founder
- * nick is dropped or expires */
- char founderpass[PASSMAX];
- char *desc;
- char *url;
- char *email;
-
- time_t time_registered;
- time_t last_used;
- char *last_topic; /* Last topic on the channel */
- 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;
-
- int16 bantype;
- int16 *levels; /* Access levels for commands */
-
- uint16 accesscount;
- ChanAccess *access; /* List of authorized users */
- uint16 akickcount;
- AutoKick *akick; /* List of users to kickban */
-
- uint32 mlock_on, mlock_off; /* See channel modes below */
- uint32 mlock_limit; /* 0 if no limit */
- char *mlock_key; /* NULL if no key */
- char *mlock_flood; /* NULL if no +f */
- char *mlock_redirect; /* NULL if no +L */
-
- char *entry_message; /* Notice sent on entering channel */
-
- MemoInfo memos;
-
- struct channel_ *c; /* Pointer to channel record (if *
- * channel is currently in use) */
-
- ModuleData *moduleData; /* Module saved data attached to the ChannelInfo */
-
- /* For BotServ */
-
- BotInfo *bi; /* Bot used on this channel */
- uint32 botflags; /* BS_* below */
- int16 *ttb; /* Times to ban for each kicker */
-
- uint16 bwcount;
- BadWord *badwords; /* For BADWORDS kicker */
- int16 capsmin, capspercent; /* For CAPS kicker */
- int16 floodlines, floodsecs; /* For FLOOD kicker */
- int16 repeattimes; /* For REPEAT kicker */
-};
+#include "regchannel.h"
/* Retain topic even after last person leaves channel */
#define CI_KEEPTOPIC 0x00000001