Client: add method GetInstance()

This commit is contained in:
Max Kellermann
2017-02-25 10:00:05 +01:00
parent 668724de4e
commit 05b8ddac4c
8 changed files with 33 additions and 21 deletions

View File

@@ -24,7 +24,6 @@
#include "client/ClientList.hxx"
#include "client/Response.hxx"
#include "Instance.hxx"
#include "Partition.hxx"
#include "util/ConstBuffer.hxx"
#include <set>
@@ -80,7 +79,7 @@ handle_channels(Client &client, gcc_unused Request args, Response &r)
assert(args.IsEmpty());
std::set<std::string> channels;
for (const auto &c : *client.partition.instance.client_list)
for (const auto &c : *client.GetInstance().client_list)
channels.insert(c.subscriptions.begin(),
c.subscriptions.end());
@@ -122,7 +121,7 @@ handle_send_message(Client &client, Request args, Response &r)
bool sent = false;
const ClientMessage msg(channel_name, message_text);
for (auto &c : *client.partition.instance.client_list)
for (auto &c : *client.GetInstance().client_list)
if (c.PushMessage(msg))
sent = true;