summary refs log tree commit diff
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-12 19:17:26 +1000
committerGitHub <noreply@github.com>2022-09-12 19:17:26 +1000
commit2a40883fffc77cfa9f59d682fbe512c0f39f6df8 (patch)
tree80801afbf1e5ce8f45b83192ed9dc66a8290f29a
parentMerge pull request #886 from fosscord/dev/Maddy/fix/notes_migration (diff)
parentFix typo (diff)
downloadserver-2a40883fffc77cfa9f59d682fbe512c0f39f6df8.tar.xz
Merge pull request #883 from fosscord/dev/Maddy/feat/spotify_activity
Allow Spotify activities through schema
-rw-r--r--src/util/interfaces/Activity.ts9
-rw-r--r--src/util/schemas/ActivitySchema.ts11
2 files changed, 19 insertions, 1 deletions
diff --git a/src/util/interfaces/Activity.ts b/src/util/interfaces/Activity.ts
index 3b36b4a6..7e9c6a56 100644
--- a/src/util/interfaces/Activity.ts
+++ b/src/util/interfaces/Activity.ts
@@ -33,6 +33,15 @@ export interface Activity {
 	};
 	instance?: boolean;
 	flags: string; // activity flags OR d together, describes what the payload includes
+	// spotify and other rich presence data
+	id?: string;
+	sync_id?: string;
+	metadata?: {
+		context_uri?: string;
+		album_id?: string;
+		artist_ids?: string[];
+	},
+	session_id?: string;
 }
 
 export enum ActivityType {
diff --git a/src/util/schemas/ActivitySchema.ts b/src/util/schemas/ActivitySchema.ts
index d94557ea..db42fff4 100644
--- a/src/util/schemas/ActivitySchema.ts
+++ b/src/util/schemas/ActivitySchema.ts
@@ -37,7 +37,16 @@ export const ActivitySchema = {
 				$match: String
 			},
 			$instance: Boolean,
-			$flags: String
+			$flags: String,
+			// spotify and other rich presence data
+			$id: String,
+			$sync_id: String,
+			$metadata: {
+				$context_uri: String,
+				$album_id: String,
+				$artist_ids: [String],
+			},
+			$session_id: String,
 		}
 	],
 	$since: Number // unix time (in milliseconds) of when the client went idle, or null if the client is not idle