User mentions: use user_id IN (...) rather than user_id = ... OR user_id = ...

This commit is contained in:
Rory&
2026-05-21 16:25:52 +02:00
parent 0304f68980
commit 558dc94489
+1 -1
View File
@@ -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);