refactor: prefer room_settings over registered_groups in runtime reads

This commit is contained in:
Eyejoker
2026-03-31 22:27:36 +09:00
parent 1f1842773e
commit e730fea230
4 changed files with 17 additions and 15 deletions

View File

@@ -2770,7 +2770,12 @@ function canRunTribunalFromRegisteredAgentTypes(
}
export function getEffectiveRuntimeRoomMode(chatJid: string): RoomMode {
return getEffectiveRoomMode(chatJid) === 'tribunal' &&
const stored = getStoredRoomSettings(chatJid);
if (stored) {
return stored.roomMode;
}
return inferStoredRoomModeForJid(chatJid) === 'tribunal' &&
canRunTribunalFromRegisteredAgentTypes(
getRegisteredAgentTypesForJid(chatJid),
)