aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/NeighborCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-04 11:33:53 +0100
committerMax Kellermann <max@duempel.org>2014-02-04 11:35:23 +0100
commitabc16b919ddb5f1d7d76774691b7d664ca5ef3ea (patch)
tree1867b4500b0433fe66337360a025a277f081de96 /src/command/NeighborCommands.cxx
parent2de7cd32eaec778f9630b682edbca3d1430cd27b (diff)
downloadmpd-abc16b919ddb5f1d7d76774691b7d664ca5ef3ea.tar.gz
mpd-abc16b919ddb5f1d7d76774691b7d664ca5ef3ea.tar.xz
mpd-abc16b919ddb5f1d7d76774691b7d664ca5ef3ea.zip
{Message,Neighbor}Commands: use Client::partition instead of Main.hxx
Diffstat (limited to '')
-rw-r--r--src/command/NeighborCommands.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/command/NeighborCommands.cxx b/src/command/NeighborCommands.cxx
index ee88c7935..1171f6424 100644
--- a/src/command/NeighborCommands.cxx
+++ b/src/command/NeighborCommands.cxx
@@ -21,7 +21,7 @@
#include "NeighborCommands.hxx"
#include "client/Client.hxx"
#include "Instance.hxx"
-#include "Main.hxx"
+#include "Partition.hxx"
#include "protocol/Result.hxx"
#include "neighbor/Glue.hxx"
#include "neighbor/Info.hxx"
@@ -32,23 +32,24 @@
#include <assert.h>
bool
-neighbor_commands_available()
+neighbor_commands_available(const Instance &instance)
{
- return instance->neighbors != nullptr;
+ return instance.neighbors != nullptr;
}
CommandResult
handle_listneighbors(Client &client,
gcc_unused int argc, gcc_unused char *argv[])
{
- if (instance->neighbors == nullptr) {
+ const NeighborGlue *const neighbors =
+ client.partition.instance.neighbors;
+ if (neighbors == nullptr) {
command_error(client, ACK_ERROR_UNKNOWN,
"No neighbor plugin configured");
return CommandResult::ERROR;
}
- const auto neighbors = instance->neighbors->GetList();
- for (const auto &i : neighbors)
+ for (const auto &i : neighbors->GetList())
client_printf(client,
"neighbor: %s\n"
"name: %s\n",