mirror of
https://github.com/SuperBFG7/ympd
synced 2025-11-24 17:24:49 +00:00
Merge branch 'send-message' of https://github.com/SuperBFG7/ympd into SuperBFG7-send-message
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <libgen.h>
|
||||
#include <mpd/client.h>
|
||||
#include <mpd/message.h>
|
||||
|
||||
#include "mpd_client.h"
|
||||
#include "config.h"
|
||||
@@ -241,6 +242,27 @@ out_save_queue:
|
||||
out_search:
|
||||
free(p_charbuf);
|
||||
break;
|
||||
case MPD_API_SEND_MESSAGE:
|
||||
p_charbuf = strdup(c->content);
|
||||
if(strcmp(strtok(p_charbuf, ","), "MPD_API_SEND_MESSAGE"))
|
||||
goto out_send_message;
|
||||
|
||||
if((token = strtok(NULL, ",")) == NULL)
|
||||
goto out_send_message;
|
||||
|
||||
free(p_charbuf);
|
||||
p_charbuf = strdup(get_arg1(c->content));
|
||||
|
||||
if ( strtok(p_charbuf, ",") == NULL )
|
||||
goto out_send_message;
|
||||
|
||||
if ( (token = strtok(NULL, ",")) == NULL )
|
||||
goto out_send_message;
|
||||
|
||||
mpd_run_send_message(mpd.conn, p_charbuf, token);
|
||||
out_send_message:
|
||||
free(p_charbuf);
|
||||
break;
|
||||
#ifdef WITH_MPD_HOST_CHANGE
|
||||
/* Commands allowed when disconnected from MPD server */
|
||||
case MPD_API_SET_MPDHOST:
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
X(MPD_API_RM_ALL) \
|
||||
X(MPD_API_MOVE_TRACK) \
|
||||
X(MPD_API_SEARCH) \
|
||||
X(MPD_API_SEND_MESSAGE) \
|
||||
X(MPD_API_SET_VOLUME) \
|
||||
X(MPD_API_SET_PAUSE) \
|
||||
X(MPD_API_SET_PLAY) \
|
||||
|
||||
Reference in New Issue
Block a user