fix: drop source header (breaks msg/chats) + context-aware talker_id

Live validation found two real bugs:
- YunkeClient sent 'source: yunkepc' on every request; msg/chats binds
  source as Integer -> 500. Removed (cookie auth suffices, per Phase 0).
- WeChat message talker_id used the masked 'talker' field; the timeline
  joins on the full peer id. Now: 1:1 -> oriTalker (full), group -> talker
  (member). ori_talker keeps the raw oriTalker (peer/chatroom).

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
浅念
2026-08-01 16:52:48 +08:00
parent b822e87d4d
commit 4dcfc66741
4 changed files with 22 additions and 6 deletions
+11 -1
View File
@@ -346,11 +346,21 @@ def _normalize_message(record: dict[str, Any]) -> dict[str, Any]:
if timestamp is None:
timestamp = record.get("createTime")
# talker_id = the message's sender/peer FULL id (the timeline join key).
# 1:1 (empty roomid): upstream `talker` is masked, the full peer is
# `oriTalker`. group (roomid set): `talker` is the sending member, while
# `oriTalker` is the chatroom id — so the member is in `talker`.
roomid = record.get("roomid") or ""
if roomid:
talker_id = record.get("talker")
else:
talker_id = record.get("oriTalker") or record.get("talker")
return {
"msg_id": record.get("msgSvrId"),
"channel": "wechat",
"owner_account_id": record.get("wechatId"),
"talker_id": record.get("talker"),
"talker_id": talker_id,
"ori_talker": record.get("oriTalker"),
"room_id": record.get("roomid"),
"is_send": is_send,