Preserve conversation excerpts and deduplicate case evidence
This commit is contained in:
@@ -123,9 +123,15 @@ export function serverChatTimeline(server: ServerRow, tail: TailResult): Context
|
||||
export function matchChatTimeline(matchId: number): ContextualChatEntry[] {
|
||||
return (
|
||||
db()
|
||||
.prepare('SELECT entry FROM match_chat WHERE match_id = ? ORDER BY rowid')
|
||||
.all(matchId) as { entry: string }[]
|
||||
).map((row) => JSON.parse(row.entry));
|
||||
.prepare(
|
||||
'SELECT message_key,occurrence,entry FROM match_chat WHERE match_id = ? ORDER BY rowid'
|
||||
)
|
||||
.all(matchId) as { message_key: string; occurrence: number; entry: string }[]
|
||||
).map((row) => ({
|
||||
...JSON.parse(row.entry),
|
||||
matchId,
|
||||
messageId: `${matchId}:${row.message_key}:${row.occurrence}`
|
||||
}));
|
||||
}
|
||||
|
||||
/** Save before filtering the live view so completed matches retain their messages. */
|
||||
|
||||
Reference in New Issue
Block a user