From b591e8cdc8b1bc40a6a59b54dcb6266d9656b616 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 28 Dec 2012 10:37:54 -0500 Subject: Use the same object for chanusercontainer and userchancontainer --- include/channels.h | 17 ++++++++--------- include/users.h | 17 +++-------------- 2 files changed, 11 insertions(+), 23 deletions(-) (limited to 'include') diff --git a/include/channels.h b/include/channels.h index 5cbea5ecc..b8801ff07 100644 --- a/include/channels.h +++ b/include/channels.h @@ -20,18 +20,16 @@ typedef Anope::hash_map channel_map; extern CoreExport channel_map ChannelList; /* A user container, there is one of these per user per channel. */ -struct UserContainer : public Extensible +struct ChanUserContainer : public Extensible { User *user; + Channel *chan; /* Status the user has in the channel */ - ChannelStatus *status; + ChannelStatus status; - UserContainer(User *u) : user(u) { } - virtual ~UserContainer() { } + ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { } }; -typedef std::list CUserList; - enum ChannelFlag { /* ChanServ is currently holding the channel */ @@ -60,7 +58,8 @@ class CoreExport Channel : public Base, public Extensible, public Flags ChanUserList; + ChanUserList users; /* Current topic of the channel */ Anope::string topic; @@ -107,7 +106,7 @@ class CoreExport Channel : public Base, public Extensible, public Flags UChannelList; - /* Online user and channel data. */ class CoreExport User : public virtual Base, public Extensible, public CommandReply { @@ -89,7 +77,8 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe bool super_admin; /* Channels the user is in */ - UChannelList chans; + typedef std::list ChanUserList; + ChanUserList chans; /* Last time this user sent a memo command used */ time_t lastmemosend; @@ -319,7 +308,7 @@ class CoreExport User : public virtual Base, public Extensible, public CommandRe * @param c The channel * @return The channel container, or NULL */ - ChannelContainer *FindChannel(const Channel *c) const; + ChanUserContainer *FindChannel(const Channel *c) const; /** Check if the user is protected from kicks and negative mode changes * @return true or false -- cgit