fix(qzone): 修复子评论回复逻辑
移除手动构造的@提醒内容,改为通过传递 `parent_tid` 参数来正确指定父评论。 这利用了平台原生的回复机制,可以更可靠地实现回复和提醒功能。
This commit is contained in:
@@ -791,10 +791,11 @@ class QZoneService:
|
|||||||
try:
|
try:
|
||||||
# 修复回复逻辑:确保能正确提醒被回复的人
|
# 修复回复逻辑:确保能正确提醒被回复的人
|
||||||
data = {
|
data = {
|
||||||
"topicId": f"{host_qq}_{fid}__1", # 使用标准评论格式,而不是针对特定评论
|
"topicId": f"{host_qq}_{fid}__1",
|
||||||
|
"parent_tid": comment_tid,
|
||||||
"uin": uin,
|
"uin": uin,
|
||||||
"hostUin": host_qq,
|
"hostUin": host_qq,
|
||||||
"content": f"回复@{target_name}:{content}", # 内容中明确标示回复对象
|
"content": content,
|
||||||
"format": "fs",
|
"format": "fs",
|
||||||
"plat": "qzone",
|
"plat": "qzone",
|
||||||
"source": "ic",
|
"source": "ic",
|
||||||
@@ -802,11 +803,13 @@ class QZoneService:
|
|||||||
"ref": "feeds",
|
"ref": "feeds",
|
||||||
"richtype": "",
|
"richtype": "",
|
||||||
"richval": "",
|
"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)
|
await _request("POST", self.REPLY_URL, params={"g_tk": gtk}, data=data)
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user