feat(server): filter DM read states from ready payload for federated users

This commit is contained in:
Jannis Braun
2026-04-02 11:33:59 +02:00
parent b1ba7b35d2
commit 1d81838868
+3 -1
View File
@@ -1335,7 +1335,9 @@ function buildReadyPayload(userId: string): {
.where(eq(schema.readStates.userId, userId)) .where(eq(schema.readStates.userId, userId))
.all(); .all();
const readStates: ReadState[] = readStateRows.map(rs => ({ const readStates: ReadState[] = readStateRows
.filter(rs => !isFederated || visibleChannelIdSet.has(rs.channelId))
.map(rs => ({
channelId: rs.channelId, channelId: rs.channelId,
lastReadMessageId: rs.lastReadMessageId, lastReadMessageId: rs.lastReadMessageId,
})); }));