Skip to content

Commit

Permalink
Fixed regression where some list item is not reporting name.
Browse files Browse the repository at this point in the history
  • Loading branch information
cary-rowen committed Jan 7, 2024
1 parent 1e4194e commit 9a15cd9
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions addon/appModules/wechat.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ def event_nameChange(self, obj, nextHandler):
nextHandler()

def event_gainFocus(self, obj, nextHandler, isFocus=False):
# 读出被转发的消息
if obj.windowClassName == "ChatRecordWnd":
if obj.role == role.LISTITEM:
date = ""
msg = []
children = obj.recursiveDescendants
for child in children:
if not speech.isBlank(child.name):
from datetime import datetime
try:
datetime.strptime(child.name, "%m-%d %H:%M:%S")
date = child.name
except ValueError:
msg.append(child.name)
msg.append(date)
obj.name = ','.join(msg)
if obj.role == role.LISTITEM and obj.windowClassName == 'ChatRecordWnd'\
or obj.role == role.LISTITEM and obj.name is None:
date = ""
msg = []
children = obj.recursiveDescendants
for child in children:
if not speech.isBlank(child.name):
from datetime import datetime
try:
datetime.strptime(child.name, "%m-%d %H:%M:%S")
date = child.name
except ValueError:
msg.append(child.name)
msg.append(date)
obj.name = ','.join(msg)

# 消息列表中特殊消息音效提醒
try:
if obj.role == role.LISTITEM and obj.parent.name == "消息":
Expand Down

0 comments on commit 9a15cd9

Please sign in to comment.