summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@proton.me>2023-12-05 12:34:46 -0500
committerPuyodead1 <puyodead@proton.me>2023-12-05 12:34:46 -0500
commitb7c4889c631df394c5981f726172e7d71223e293 (patch)
treeb943a895785b36bc68ff4b53e4ebc8ffcc463438 /src/api
parenttypingstart timestamp needs to be seconds (diff)
downloadserver-b7c4889c631df394c5981f726172e7d71223e293.tar.xz
fix some message update fields being sent when null
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/channels/#channel_id/messages/#message_id/index.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
index 6bc03f53..57670fc2 100644
--- a/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
+++ b/src/api/routes/channels/#channel_id/messages/#message_id/index.ts
@@ -109,7 +109,7 @@ router.patch(
 			await emitEvent({
 				event: "MESSAGE_UPDATE",
 				channel_id,
-				data: { ...new_message, nonce: undefined },
+				data: { ...new_message.toJSON(), nonce: undefined },
 			} as MessageUpdateEvent),
 		]);
 
@@ -117,9 +117,9 @@ router.patch(
 
 		// TODO: a DTO?
 		return res.json({
+			...new_message.toJSON(),
 			id: new_message.id,
 			type: new_message.type,
-			content: new_message.content,
 			channel_id: new_message.channel_id,
 			author: new_message.author?.toPublicUser(),
 			attachments: new_message.attachments,
@@ -128,11 +128,8 @@ router.patch(
 			mention_roles: new_message.mention_roles,
 			mention_everyone: new_message.mention_everyone,
 			pinned: new_message.pinned,
-			tts: new_message.tts,
 			timestamp: new_message.timestamp,
 			edited_timestamp: new_message.edited_timestamp,
-			flags: new_message.flags,
-			components: new_message.components,
 
 			// these are not in the Discord.com response
 			mention_channels: new_message.mention_channels,