aboutsummaryrefslogtreecommitdiff
path: root/src/ClientInternal.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-03 11:31:32 +0100
committerMax Kellermann <max@duempel.org>2013-01-03 17:49:47 +0100
commitd919f8d50ab32a94b8965330297985cd14c45a42 (patch)
tree238445dc46c7206af0859b3f075f9bd0a4026648 /src/ClientInternal.hxx
parentd67aa7c19dfaf5c39b49dc8dfc486b4e99f31db1 (diff)
ClientInternal: use std::set for subscriptions
Diffstat (limited to 'src/ClientInternal.hxx')
-rw-r--r--src/ClientInternal.hxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ClientInternal.hxx b/src/ClientInternal.hxx
index ac50a3e9..be423bb2 100644
--- a/src/ClientInternal.hxx
+++ b/src/ClientInternal.hxx
@@ -24,6 +24,9 @@
#include "ClientMessage.hxx"
#include "command.h"
+#include <set>
+#include <string>
+
#include <glib.h>
#undef G_LOG_DOMAIN
@@ -82,7 +85,7 @@ public:
/**
* A list of channel names this client is subscribed to.
*/
- GSList *subscriptions;
+ std::set<std::string> subscriptions;
/**
* The number of subscriptions in #subscriptions. Used to
@@ -100,6 +103,11 @@ public:
* The number of messages in #messages.
*/
unsigned num_messages;
+
+ gcc_pure
+ bool IsSubscribed(const char *channel_name) const {
+ return subscriptions.find(channel_name) != subscriptions.end();
+ }
};
extern unsigned int client_max_connections;