summaryrefslogtreecommitdiff
path: root/include/channels.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-12-28 10:37:54 -0500
committerAdam <Adam@anope.org>2012-12-28 10:43:30 -0500
commitb591e8cdc8b1bc40a6a59b54dcb6266d9656b616 (patch)
tree2a31259930d9915d9248a29dc5b97006620675a2 /include/channels.h
parent379b2ccf92b6124f2026a5ec683cfc98f08e223a (diff)
Use the same object for chanusercontainer and userchancontainer
Diffstat (limited to 'include/channels.h')
-rw-r--r--include/channels.h17
1 files changed, 8 insertions, 9 deletions
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 *> 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<UserContainer *> CUserList;
-
enum ChannelFlag
{
/* ChanServ is currently holding the channel */
@@ -60,7 +58,8 @@ class CoreExport Channel : public Base, public Extensible, public Flags<ChannelF
time_t creation_time;
/* Users in the channel */
- CUserList users;
+ typedef std::list<ChanUserContainer *> ChanUserList;
+ ChanUserList users;
/* Current topic of the channel */
Anope::string topic;
@@ -107,7 +106,7 @@ class CoreExport Channel : public Base, public Extensible, public Flags<ChannelF
* @param u The user
* @return The UserContainer for the user
*/
- UserContainer* JoinUser(User *u);
+ ChanUserContainer* JoinUser(User *u);
/** Remove a user internally from the channel
* @param u The user
@@ -118,7 +117,7 @@ class CoreExport Channel : public Base, public Extensible, public Flags<ChannelF
* @param u The user
* @return A user container if found, else NULL
*/
- UserContainer *FindUser(const User *u) const;
+ ChanUserContainer *FindUser(const User *u) const;
/** Check if a user has a status on a channel
* @param u The user