fix(chat): 修复 list_chat_messages 中 re 作用域遮蔽

- 移除函数内局部 import re,避免遮蔽模块级 re。

- 保持 emojiUrl 处理后续正则逻辑可稳定执行。

- 新增回归测试,覆盖模板解析路径,防止同类作用域问题复发。
This commit is contained in:
2977094657
2026-02-22 18:59:08 +08:00
Unverified
parent d9e9bcc16a
commit 13febebee7
2 changed files with 67 additions and 2 deletions
-2
View File
@@ -5494,8 +5494,6 @@ def list_chat_messages(
if existing_local:
try:
import re
cur = str(m.get("emojiUrl") or "")
if cur and re.match(r"^https?://", cur, flags=re.I) and ("/api/chat/media/emoji" not in cur):
m["emojiRemoteUrl"] = cur