summary refs log tree commit diff
path: root/src/api/routes/channels
diff options
context:
space:
mode:
authorRainb0w :3 <81040339+Rainb0wCodes@users.noreply.github.com>2023-04-08 22:07:23 -0600
committerGitHub <noreply@github.com>2023-04-08 22:07:23 -0600
commit2c067969a0699c359b3642791999407c2289cdaa (patch)
tree14554813e586a96c9fa7a616fb517f1821c1f17f /src/api/routes/channels
parentLicense information (diff)
downloadserver-2c067969a0699c359b3642791999407c2289cdaa.tar.xz
properly track reactions
Diffstat (limited to 'src/api/routes/channels')
-rw-r--r--src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts b/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts
index eafa70c8..fa1c996d 100644
--- a/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts
+++ b/src/api/routes/channels/#channel_id/messages/#message_id/reactions.ts
@@ -180,6 +180,7 @@ router.put(
 			if (already_added.user_ids.includes(req.user_id))
 				return res.sendStatus(204); // Do not throw an error ¯\_(ツ)_/¯ as discord also doesn't throw any error
 			already_added.count++;
+			already_added.user_ids.push(req.user_id);
 		} else
 			message.reactions.push({
 				count: 1,
@@ -247,6 +248,7 @@ router.delete(
 		already_added.count--;
 
 		if (already_added.count <= 0) message.reactions.remove(already_added);
+		else already_added.user_ids.splice(already_added.user_ids.indexOf(user_id), 1);
 
 		await message.save();