[mpd] Implement 'channels' command (returns the special forked-daapd

channes like 'pairing')
This commit is contained in:
chme 2017-03-25 14:13:17 +01:00
parent eeef65f951
commit 989b44c8dc

View File

@ -3819,6 +3819,21 @@ mpd_find_channel(const char *name)
return NULL;
}
static int
mpd_command_channels(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
{
int i;
for (i = 0; mpd_channels[i].handler; i++)
{
evbuffer_add_printf(evbuf,
"channel: %s\n",
mpd_channels[i].channel);
}
return 0;
}
static int
mpd_command_sendmessage(struct evbuffer *evbuf, int argc, char **argv, char **errmsg)
{
@ -4381,7 +4396,7 @@ static struct mpd_command mpd_handlers[] =
},
{
.mpdcommand = "channels",
.handler = mpd_command_ignore
.handler = mpd_command_channels
},
{
.mpdcommand = "readmessages",