Scope live chat to the current match and save match history
This commit is contained in:
@@ -17,9 +17,10 @@ export interface ChatContext {
|
||||
round: number | null;
|
||||
}
|
||||
|
||||
export type ContextualChatEntry = ChatEntry & { context: ChatContext };
|
||||
export type ContextualChatEntry = ChatEntry & { context: ChatContext; matchId?: number };
|
||||
|
||||
export interface ChatMatch {
|
||||
id?: number;
|
||||
startedAt: string;
|
||||
endedAt: string | null;
|
||||
lastReceivedAt: string;
|
||||
@@ -174,6 +175,6 @@ export function enrichGameChatTimeline(lines: readonly string[], options: {
|
||||
}
|
||||
}
|
||||
if (entry.type === 'boundary' && entry.event === 'end') logEnded = true;
|
||||
return { ...entry, context };
|
||||
return { ...entry, context, ...(match?.id === undefined ? {} : { matchId: match.id }) };
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user