aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/AllCommands.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/AllCommands.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 'src/command/AllCommands.cxx')
-rw-r--r--src/command/AllCommands.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/command/AllCommands.cxx b/src/command/AllCommands.cxx
index 3bc6ff6a9..2ac55e715 100644
--- a/src/command/AllCommands.cxx
+++ b/src/command/AllCommands.cxx
@@ -32,6 +32,7 @@
#include "Permission.hxx"
#include "tag/TagType.h"
#include "protocol/Result.hxx"
+#include "Partition.hxx"
#include "client/Client.hxx"
#include "util/Tokenizer.hxx"
#include "util/Error.hxx"
@@ -184,7 +185,8 @@ static const struct command commands[] = {
static const unsigned num_commands = sizeof(commands) / sizeof(commands[0]);
static bool
-command_available(gcc_unused const struct command *cmd)
+command_available(gcc_unused const Partition &partition,
+ gcc_unused const struct command *cmd)
{
#ifdef ENABLE_SQLITE
if (strcmp(cmd->cmd, "sticker") == 0)
@@ -193,7 +195,7 @@ command_available(gcc_unused const struct command *cmd)
#ifdef ENABLE_NEIGHBOR_PLUGINS
if (strcmp(cmd->cmd, "listneighbors") == 0)
- return neighbor_commands_available();
+ return neighbor_commands_available(partition.instance);
#endif
return true;
@@ -211,7 +213,7 @@ handle_commands(Client &client,
cmd = &commands[i];
if (cmd->permission == (permission & cmd->permission) &&
- command_available(cmd))
+ command_available(client.partition, cmd))
client_printf(client, "command: %s\n", cmd->cmd);
}