From c9a55302305ec070cc03f4329e26b98f8034cefc Mon Sep 17 00:00:00 2001
From: Lars-Dominik Braun <lars@6xq.net>
Date: Mon, 21 Mar 2011 12:57:56 +0100
Subject: piano: Delete feedback

---
 src/libpiano/piano.c | 21 +++++++++++++++++++++
 src/libpiano/piano.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/src/libpiano/piano.c b/src/libpiano/piano.c
index e475799..9075df7 100644
--- a/src/libpiano/piano.c
+++ b/src/libpiano/piano.c
@@ -735,6 +735,26 @@ PianoReturn_t PianoRequest (PianoHandle_t *ph, PianoRequest_t *req,
 			break;
 		}
 
+		case PIANO_REQUEST_DELETE_FEEDBACK: {
+			PianoSong_t *song = req->data;
+
+			assert (song != NULL);
+
+			snprintf (xmlSendBuf, sizeof (xmlSendBuf), "<?xml version=\"1.0\"?>"
+					"<methodCall><methodName>station.deleteFeedback</methodName>"
+					"<params><param><value><int>%lu</int></value></param>"
+					/* auth token */
+					"<param><value><string>%s</string></value></param>"
+					/* feedback id */
+					"<param><value><string>%s</string></value></param>"
+					"</params></methodCall>", (unsigned long) timestamp,
+					ph->user.authToken, song->feedbackId);
+			snprintf (req->urlPath, sizeof (req->urlPath), PIANO_RPC_PATH
+					"rid=%s&lid=%s&method=deleteFeedback&arg1=%s",
+					ph->routeId, ph->user.listenerId, song->feedbackId);
+			break;
+		}
+
 		/* "high-level" wrapper */
 		case PIANO_REQUEST_RATE_SONG: {
 			/* love/ban song */
@@ -1006,6 +1026,7 @@ PianoReturn_t PianoResponse (PianoHandle_t *ph, PianoRequest_t *req) {
 		case PIANO_REQUEST_SET_QUICKMIX:
 		case PIANO_REQUEST_BOOKMARK_SONG:
 		case PIANO_REQUEST_BOOKMARK_ARTIST:
+		case PIANO_REQUEST_DELETE_FEEDBACK:
 			assert (req->responseData != NULL);
 
 			ret = PianoXmlParseSimple (req->responseData);
diff --git a/src/libpiano/piano.h b/src/libpiano/piano.h
index c91b7e9..d013363 100644
--- a/src/libpiano/piano.h
+++ b/src/libpiano/piano.h
@@ -144,6 +144,7 @@ typedef enum {
 	PIANO_REQUEST_BOOKMARK_SONG = 18,
 	PIANO_REQUEST_BOOKMARK_ARTIST = 19,
 	PIANO_REQUEST_GET_STATION_INFO = 20,
+	PIANO_REQUEST_DELETE_FEEDBACK = 21,
 } PianoRequestType_t;
 
 typedef struct PianoRequest {
-- 
cgit v1.2.3