From 7b537e96d0160524d87ce57d84fddf9502362c78 Mon Sep 17 00:00:00 2001 From: tt-P607 <68868379+tt-P607@users.noreply.github.com> Date: Thu, 4 Sep 2025 14:44:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(qzone):=20=E4=BF=AE=E5=A4=8D=E5=AD=90?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E5=9B=9E=E5=A4=8D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除手动构造的@提醒内容,改为通过传递 `parent_tid` 参数来正确指定父评论。 这利用了平台原生的回复机制,可以更可靠地实现回复和提醒功能。 --- .../maizone_refactored/services/qzone_service.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/plugins/built_in/maizone_refactored/services/qzone_service.py b/src/plugins/built_in/maizone_refactored/services/qzone_service.py index 2a36f822c..6960dd5ab 100644 --- a/src/plugins/built_in/maizone_refactored/services/qzone_service.py +++ b/src/plugins/built_in/maizone_refactored/services/qzone_service.py @@ -791,10 +791,11 @@ class QZoneService: try: # 修复回复逻辑:确保能正确提醒被回复的人 data = { - "topicId": f"{host_qq}_{fid}__1", # 使用标准评论格式,而不是针对特定评论 + "topicId": f"{host_qq}_{fid}__1", + "parent_tid": comment_tid, "uin": uin, "hostUin": host_qq, - "content": f"回复@{target_name}:{content}", # 内容中明确标示回复对象 + "content": content, "format": "fs", "plat": "qzone", "source": "ic", @@ -802,12 +803,14 @@ class QZoneService: "ref": "feeds", "richtype": "", "richval": "", - "paramstr": f"@{target_name}", # 确保触发@提醒机制 + "paramstr": "", } - + # 记录详细的请求参数用于调试 - logger.info(f"子回复请求参数: topicId={data['topicId']}, parent_tid={data['parent_tid']}, content='{content[:50]}...'") - + logger.info( + f"子回复请求参数: topicId={data['topicId']}, parent_tid={data['parent_tid']}, content='{content[:50]}...'" + ) + await _request("POST", self.REPLY_URL, params={"g_tk": gtk}, data=data) return True except Exception as e: