兼容对话只变化表情 3269/1 3269/head 3275/target/1
authorxue <2144439972@qq.com>
Fri, 13 Mar 2026 01:52:36 +0000 (09:52 +0800)
committerxue <2144439972@qq.com>
Fri, 13 Mar 2026 01:52:36 +0000 (09:52 +0800)
code/sdk/zhihui/leiniao/imsl_ln/ln_api_story_random.c

index 8484f49..adda191 100644 (file)
@@ -266,11 +266,16 @@ void ln_parse_voice_chat_response(const char *json_str, int json_len)
         }
     }
 
+    /* 兼容:无 textContent 或为空但有 npcEmotion 时,只切换表情,不推送/入队文本,保留上一次的 textContent;其他正常执行 */
     if (text_str && text_str[0])
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "用户文本内容: %s\n", text_str);
         push_text_to_ui(text_str);
     }
+    else if (npc_emotion_str)
+    {
+        WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "VoiceChatResponse: no textContent, emotion-only update, keep previous text\n");
+    }
     else
     {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "textContent is null\n");