feat(chat): 聊天排版升级微信标准(左右分侧+头像+绿气泡)+is_send数据修复
- is_send 根因:云客消息方向在 mine 字段(isSend 全 null),归一化加 fallback +存量回填 60.7 万行(51万收/16万发)——分侧数据首次完整 - MessageBubble:头像(对方=raw headUrl 在左/自己=默认在右)、自己侧隐藏昵称、 接收白底描边/发送微信绿 #95ec69、气泡列 max-width 78% - 实测混合对话:13发(绿+头像右)/7收(白+头像左)全部正确 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -655,7 +655,10 @@ async def scrape_messages(cookie_str: str, max_conversations: int = 100):
|
||||
# 用发送的 friend_id(与客户表一致)优先,API 返回的 talker 可能脱敏
|
||||
"talker_id": friend_id or row.get("talker") or row.get("oriTalker"),
|
||||
"room_id": None,
|
||||
"is_send": bool(row.get("isSend", 0)) if row.get("isSend") is not None else None,
|
||||
"is_send": (
|
||||
bool(row["isSend"]) if row.get("isSend") is not None
|
||||
else (bool(row["mine"]) if row.get("mine") is not None else None)
|
||||
),
|
||||
"type": _normalize_msg_type(row.get("type")),
|
||||
"type_raw": row.get("type"),
|
||||
"text": row.get("content") or row.get("text") or "",
|
||||
@@ -744,7 +747,10 @@ def _normalize_group_message(row: dict, owner_id: str, room_id: str) -> dict | N
|
||||
"owner_account_id": owner_id,
|
||||
"talker_id": talker or None,
|
||||
"room_id": row.get("roomid") or room_id,
|
||||
"is_send": bool(row.get("isSend", 0)) if row.get("isSend") is not None else None,
|
||||
"is_send": (
|
||||
bool(row["isSend"]) if row.get("isSend") is not None
|
||||
else (bool(row["mine"]) if row.get("mine") is not None else None)
|
||||
),
|
||||
"type": _normalize_msg_type(row.get("type")),
|
||||
"type_raw": row.get("type"),
|
||||
"text": row.get("content") or row.get("text") or "",
|
||||
|
||||
Reference in New Issue
Block a user