aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c
index 14ba2c300..1037c812d 100644
--- a/src/command.c
+++ b/src/command.c
@@ -1239,6 +1239,17 @@ static int handlePlaylistAdd(struct client *client,
return print_playlist_result(client, result);
}
+static int
+handle_idle(struct client *client,
+ mpd_unused int argc, mpd_unused char *argv[])
+{
+ /* enable "idle" mode on this client */
+ client_idle_wait(client);
+
+ /* return value is "1" so the caller won't print "OK" */
+ return 1;
+}
+
void initCommands(void)
{
commandList = makeList(free, 1);
@@ -1307,6 +1318,7 @@ void initCommands(void)
addCommand(COMMAND_TAGTYPES, PERMISSION_READ, 0, 0, handleTagTypes);
addCommand(COMMAND_COUNT, PERMISSION_READ, 2, -1, handleCount);
addCommand(COMMAND_RENAME, PERMISSION_CONTROL, 2, 2, handleRename);
+ addCommand("idle", PERMISSION_READ, 0, 0, handle_idle);
sortList(commandList);
}