Client: add method GetInstance()
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user