fix: /clear now resets both owner and reviewer sessions in paired rooms

This commit is contained in:
Eyejoker
2026-03-29 19:00:42 +09:00
parent a1e5418a2f
commit 9e0de1297c
10 changed files with 87 additions and 36 deletions

View File

@@ -37,6 +37,7 @@ import {
initDatabase,
setRegisteredGroup,
setRouterState,
deleteAllSessionsForGroup,
deleteSession,
setSession,
storeChatMetadata,
@@ -208,9 +209,16 @@ function saveState(): void {
setRouterState('last_agent_seq', JSON.stringify(lastAgentTimestamp));
}
function clearSession(groupFolder: string): void {
function clearSession(
groupFolder: string,
opts?: { allRoles?: boolean },
): void {
delete sessions[groupFolder];
deleteSession(groupFolder);
if (opts?.allRoles) {
deleteAllSessionsForGroup(groupFolder);
} else {
deleteSession(groupFolder);
}
}
function registerGroup(jid: string, group: RegisteredGroup): void {