fix: Audiences站点未读消息数解析错误

优先使用Audiences特有的解析逻辑(从"总数/未读数"格式提取真正的未读数),
仅在匹配不到时才fallback到NexusPHP基类的通用正则,避免基类将总消息数
误判为未读数导致发送大量错误通知。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
jxxghp
2026-05-19 12:55:39 +08:00
parent 34ff80e26c
commit f46488cb9c

View File

@@ -17,13 +17,10 @@ class NexusAudiencesSiteUserInfo(NexusPhpSiteUserInfo):
"""
解析 Audiences 新版顶部用户栏中的未读消息数。
"""
super()._parse_message_unread(html_text)
if self.message_unread:
return
html = etree.HTML(html_text)
try:
if not StringUtils.is_valid_html_element(html):
super()._parse_message_unread(html_text)
return
message_tools = html.xpath(
@@ -42,6 +39,8 @@ class NexusAudiencesSiteUserInfo(NexusPhpSiteUserInfo):
if html is not None:
del html
super()._parse_message_unread(html_text)
def _parse_message_unread_links(self, html_text: str, msg_links: list):
"""
解析 Audiences 未读消息链接。