diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-06-02 00:28:55 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-06-02 00:28:55 +0200 |
commit | b01dc3cb865c2faacfa69f6a081117bf349c6f40 (patch) | |
tree | 085867c898f36c12260a5933b74df1b11a623363 /include/channels.h | |
parent | 3e704abc5af27cc6d8d3e5e720d2fe497b423417 (diff) |
Move a few trivial functions into headers
Diffstat (limited to 'include/channels.h')
-rw-r--r-- | include/channels.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/include/channels.h b/include/channels.h index b71da1570..44198724c 100644 --- a/include/channels.h +++ b/include/channels.h @@ -129,13 +129,11 @@ class CoreExport Channel : public Extensible, public InviteBase int SetTopic(User *u, std::string &t, bool forceset = false); /** Obtain the channel "user counter" - * This returns the channel reference counter, which is initialized - * to 0 when the channel is created and incremented/decremented - * upon joins, parts quits and kicks. + * This returns the number of users on this channel * * @return The number of users on this channel */ - long GetUserCounter(); + long GetUserCounter() const { return userlist.size(); } /** Add a user pointer to the internal reference list * @param user The user to add @@ -161,7 +159,7 @@ class CoreExport Channel : public Extensible, public InviteBase * * @return This function returns pointer to a map of User pointers (CUList*). */ - const UserMembList* GetUsers(); + const UserMembList* GetUsers() const { return &userlist; } /** Returns true if the user given is on the given channel. * @param user The user to look for @@ -357,3 +355,8 @@ class CoreExport Channel : public Extensible, public InviteBase */ ModResult GetExtBanStatus(User *u, char type); }; + +inline bool Channel::HasUser(User* user) +{ + return (userlist.find(user) != userlist.end()); +} |