summary refs log tree commit diff
path: root/api/src/routes
diff options
context:
space:
mode:
authorFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-03 04:04:34 +0200
committerFlam3rboy <34555296+Flam3rboy@users.noreply.github.com>2021-09-03 04:04:34 +0200
commite662c983b31b5f437084f1b78b542d67fbda3182 (patch)
tree51bc887fdea0fccb600abab636311adaa1fb86ac /api/src/routes
parent:bug: fix #289 (diff)
downloadserver-e662c983b31b5f437084f1b78b542d67fbda3182.tar.xz
:bug: fix message sending
Diffstat (limited to 'api/src/routes')
-rw-r--r--api/src/routes/channels/#channel_id/messages/#message_id/index.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/api/src/routes/channels/#channel_id/messages/#message_id/index.ts b/api/src/routes/channels/#channel_id/messages/#message_id/index.ts
index 9c631a18..7a00de43 100644
--- a/api/src/routes/channels/#channel_id/messages/#message_id/index.ts
+++ b/api/src/routes/channels/#channel_id/messages/#message_id/index.ts
@@ -20,7 +20,8 @@ router.patch("/", check(MessageCreateSchema), async (req: Request, res: Response
 	}
 
 	const new_message = await handleMessage({
-		// TODO: should be message_reference overridable?
+		...message,
+		// TODO: should message_reference be overridable?
 		// @ts-ignore
 		message_reference: message.message_reference,
 		...body,
@@ -35,7 +36,7 @@ router.patch("/", check(MessageCreateSchema), async (req: Request, res: Response
 		await emitEvent({
 			event: "MESSAGE_UPDATE",
 			channel_id,
-			data: { ...message, nonce: undefined }
+			data: { ...new_message, nonce: undefined }
 		} as MessageUpdateEvent)
 	]);