summaryrefslogtreecommitdiff
path: root/src/client/ClientIdle.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-01-20 00:20:12 +0100
committerMax Kellermann <max@musicpd.org>2018-01-20 00:22:47 +0100
commit86c7ab29f42cf615e8dfe8837cda54f4b02c4c6e (patch)
treefa397387330078fe2b178599355b85299230c217 /src/client/ClientIdle.cxx
parentdb89e5ec285ea8a30a5d72c8a1bd0d734e66a2db (diff)
client/Idle: pass Response instead of Client to WriteIdleResponse()
Diffstat (limited to 'src/client/ClientIdle.cxx')
-rw-r--r--src/client/ClientIdle.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/ClientIdle.cxx b/src/client/ClientIdle.cxx
index 11713346e..a3a138e34 100644
--- a/src/client/ClientIdle.cxx
+++ b/src/client/ClientIdle.cxx
@@ -19,21 +19,21 @@
#include "config.h"
#include "ClientInternal.hxx"
+#include "Response.hxx"
#include "Idle.hxx"
#include <assert.h>
static void
-WriteIdleResponse(Client &client, unsigned flags) noexcept
+WriteIdleResponse(Response &r, unsigned flags) noexcept
{
const char *const*idle_names = idle_get_names();
for (unsigned i = 0; idle_names[i]; ++i) {
if (flags & (1 << i))
- client_printf(client, "changed: %s\n",
- idle_names[i]);
+ r.Format("changed: %s\n", idle_names[i]);
}
- client.Write("OK\n");
+ r.Write("OK\n");
}
void
@@ -45,7 +45,8 @@ Client::IdleNotify() noexcept
unsigned flags = std::exchange(idle_flags, 0) & idle_subscriptions;
idle_waiting = false;
- WriteIdleResponse(*this, flags);
+ Response r(*this, 0);
+ WriteIdleResponse(r, flags);
timeout_event.Schedule(client_timeout);
}