refactor: normalize inbound context
This commit is contained in:
@@ -59,7 +59,9 @@ export function loadSessionEntry(sessionKey: string) {
|
||||
export function classifySessionKey(key: string, entry?: SessionEntry): GatewaySessionRow["kind"] {
|
||||
if (key === "global") return "global";
|
||||
if (key === "unknown") return "unknown";
|
||||
if (entry?.chatType === "group" || entry?.chatType === "room") return "group";
|
||||
if (entry?.chatType === "group" || entry?.chatType === "channel" || entry?.chatType === "room") {
|
||||
return "group";
|
||||
}
|
||||
if (key.startsWith("group:") || key.includes(":group:") || key.includes(":channel:")) {
|
||||
return "group";
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export type GatewaySessionRow = {
|
||||
subject?: string;
|
||||
room?: string;
|
||||
space?: string;
|
||||
chatType?: "direct" | "group" | "room";
|
||||
chatType?: "direct" | "group" | "channel" | "room";
|
||||
updatedAt: number | null;
|
||||
sessionId?: string;
|
||||
systemSent?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user