From 527afc0abb164c5e18821341f5a12e9b9bec2233 Mon Sep 17 00:00:00 2001 From: Jessica James Date: Tue, 3 Jan 2017 20:44:31 -0500 Subject: [PATCH] Added Channel::UserTableType and Channel::getUsers() --- Jupiter/IRC_Client.cpp | 5 +++++ Jupiter/IRC_Client.h | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Jupiter/IRC_Client.cpp b/Jupiter/IRC_Client.cpp index 025222f..59cfdde 100644 --- a/Jupiter/IRC_Client.cpp +++ b/Jupiter/IRC_Client.cpp @@ -1638,6 +1638,11 @@ char Jupiter::IRC::Client::Channel::getUserPrefix(const Jupiter::ReadableString return 0; } +const Jupiter::IRC::Client::Channel::UserTableType &Jupiter::IRC::Client::Channel::getUsers() const +{ + return m_users; +} + size_t Jupiter::IRC::Client::Channel::getUserCount() const { return m_users.size(); diff --git a/Jupiter/IRC_Client.h b/Jupiter/IRC_Client.h index f2d160c..8f6eb92 100644 --- a/Jupiter/IRC_Client.h +++ b/Jupiter/IRC_Client.h @@ -314,6 +314,8 @@ namespace Jupiter Jupiter::StringS m_prefixes; }; + typedef Jupiter::Hash_Table UserTableType; + /** * @brief Returns the name of the channel. * @@ -377,6 +379,13 @@ namespace Jupiter */ char getUserPrefix(const Jupiter::ReadableString &in_nickname) const; + /** + * @brief Fetches the channel's user table + * + * @return Reference to the channel's user table + */ + const UserTableType &getUsers() const; + /** * @brief Returns the number of users in this channel. * @@ -413,7 +422,7 @@ namespace Jupiter Jupiter::StringS m_name; Client *m_parent; int m_type; - Jupiter::Hash_Table m_users; + UserTableType m_users; bool m_adding_names; }; // Jupiter::IRC::Client::Channel class