mirror of https://github.com/jackwener/wx-cli.git
fix: 新群/新联系人自动刷新联系人缓存
检测到消息的用户名不在联系人缓存中时,自动重新加载 contact.db,解决新建群聊一直显示 chatroom ID 的问题。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>feat/daemon-cli
parent
396d4b24e2
commit
b80e7d1c14
|
|
@ -1275,6 +1275,11 @@ class SessionMonitor:
|
|||
if is_new:
|
||||
display = self.contact_names.get(username, username)
|
||||
is_group = '@chatroom' in username
|
||||
# 新群/新联系人不在缓存中时,重新加载联系人
|
||||
if display == username and username not in self.contact_names:
|
||||
refreshed = load_contact_names()
|
||||
self.contact_names.update(refreshed)
|
||||
display = self.contact_names.get(username, username)
|
||||
sender = ''
|
||||
if is_group:
|
||||
sender = self.contact_names.get(curr['sender'], curr['sender_name'] or curr['sender'])
|
||||
|
|
|
|||
Loading…
Reference in New Issue