|
@@ -44,6 +44,7 @@ class _ActivitiesModule extends CoreClass {
|
|
* @param {string} payload.payload.message - the main message describing the activity e.g. 50 songs added to playlist 'playlist name'
|
|
* @param {string} payload.payload.message - the main message describing the activity e.g. 50 songs added to playlist 'playlist name'
|
|
* @param {string} payload.payload.thumbnail - url to a thumbnail e.g. song album art to be used when display an activity
|
|
* @param {string} payload.payload.thumbnail - url to a thumbnail e.g. song album art to be used when display an activity
|
|
* @param {string} payload.payload.youtubeId - (optional) if relevant, the youtube id of the song related to the activity
|
|
* @param {string} payload.payload.youtubeId - (optional) if relevant, the youtube id of the song related to the activity
|
|
|
|
+ * @param {string} payload.payload.reportId - (optional) if relevant, the id of the report related to the activity
|
|
* @param {string} payload.payload.playlistId - (optional) if relevant, the id of the playlist related to the activity
|
|
* @param {string} payload.payload.playlistId - (optional) if relevant, the id of the playlist related to the activity
|
|
* @param {string} payload.payload.stationId - (optional) if relevant, the id of the station related to the activity
|
|
* @param {string} payload.payload.stationId - (optional) if relevant, the id of the station related to the activity
|
|
* @returns {Promise} - returns promise (reject, resolve)
|
|
* @returns {Promise} - returns promise (reject, resolve)
|
|
@@ -300,8 +301,9 @@ class _ActivitiesModule extends CoreClass {
|
|
* Removes any references to a station, playlist or song in activities
|
|
* Removes any references to a station, playlist or song in activities
|
|
*
|
|
*
|
|
* @param {object} payload - object that contains the payload
|
|
* @param {object} payload - object that contains the payload
|
|
- * @param {string} payload.type - type of reference. enum: ["youtubeId", "stationId", "playlistId"]
|
|
|
|
|
|
+ * @param {string} payload.type - type of reference. enum: ["youtubeId", "stationId", "playlistId", "playlistId"]
|
|
* @param {string} payload.stationId - (optional) the id of a station
|
|
* @param {string} payload.stationId - (optional) the id of a station
|
|
|
|
+ * @param {string} payload.reportId - (optional) the id of a report
|
|
* @param {string} payload.playlistId - (optional) the id of a playlist
|
|
* @param {string} payload.playlistId - (optional) the id of a playlist
|
|
* @param {string} payload.youtubeId - (optional) the id of a song
|
|
* @param {string} payload.youtubeId - (optional) the id of a song
|
|
* @returns {Promise} - returns promise (reject, resolve)
|
|
* @returns {Promise} - returns promise (reject, resolve)
|
|
@@ -316,6 +318,7 @@ class _ActivitiesModule extends CoreClass {
|
|
if (
|
|
if (
|
|
(payload.type !== "youtubeId" &&
|
|
(payload.type !== "youtubeId" &&
|
|
payload.type !== "stationId" &&
|
|
payload.type !== "stationId" &&
|
|
|
|
+ payload.type !== "reportId" &&
|
|
payload.type !== "playlistId") ||
|
|
payload.type !== "playlistId") ||
|
|
!payload.type
|
|
!payload.type
|
|
)
|
|
)
|
|
@@ -351,6 +354,13 @@ class _ActivitiesModule extends CoreClass {
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (payload.reportId) {
|
|
|
|
+ activity.payload.message = activity.payload.message.replace(
|
|
|
|
+ /<reportId>(.*)<\/reportId>/g,
|
|
|
|
+ "$1"
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
if (payload.playlistId) {
|
|
if (payload.playlistId) {
|
|
activity.payload.message = activity.payload.message.replace(
|
|
activity.payload.message = activity.payload.message.replace(
|
|
/<playlistId>(.*)<\/playlistId>/g,
|
|
/<playlistId>(.*)<\/playlistId>/g,
|