fix: preserve camera permission intent and distinguish unknown reply expression

This commit is contained in:
zenord
2026-10-12 11:33:36 +08:00
parent d43c7d4e80
commit b521d368a5
26 changed files with 544 additions and 101 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ package com.gorios.lanvoice.net
// Production DialogueProtocol/JSONObject were compiled separately with actual dependencies.
class Payload(private val ok: Boolean = true, private val turn: Long? = null, private val state: String = "", private val reason: String = "", private val fields: Map<String, Any> = emptyMap()) {
fun optBoolean(key: String, fallback: Boolean) = if (key == "ok") ok else fallback
fun optString(key: String, fallback: String = "") = when (key) { "state" -> state; "reason" -> reason; else -> fallback }
fun optString(key: String, fallback: String = "") = when (key) { "state" -> state; "reason" -> reason; else -> fields[key] as? String ?: fallback }
fun optInt(key: String, fallback: Int) = if (key == "context_face_cue_version") 1 else fallback
fun opt(key: String): Any? = if (key == "turn_id") turn else fields[key]
}