summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-05-21 16:25:52 +0200
committerRory& <root@rory.gay>2026-05-26 07:48:10 +0200
commit558dc944898c50721eadd0bf63086687ee5641e5 (patch)
tree88dc088039b1152bb0eead0d26c520b01e5b6952
parentMove message mention handling to separate function (diff)
downloadserver-ts-558dc944898c50721eadd0bf63086687ee5641e5.tar.xz
User mentions: use `user_id IN (...)` rather than `user_id = ... OR user_id = ...`
-rw-r--r--src/api/util/handlers/Message.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts

index d82324df..6ec9836e 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts
@@ -788,7 +788,7 @@ async function handleMessageMentionsAsync(message: Message) { } if (users.size) { const repository = ReadState.getRepository(); - const condition = { user_id: Or(...[...users].map((id) => Equal(id))), channel_id: channel.id, read_state_type: ReadStateType.CHANNEL }; + const condition = { user_id: In(users.values().toArray()), channel_id: channel.id, read_state_type: ReadStateType.CHANNEL }; await fillInMissingIDs([...users]); await repository.increment(condition, "mention_count", 1);