优化联系人信息,解决总结时使用了其他群的备注信息

This commit is contained in:
liuwei
2025-05-28 15:38:26 +08:00
parent 555cea2be5
commit b0051dc97d

View File

@@ -95,6 +95,9 @@ class ContactManager:
# 判断是否为群组wxid以@chatroom结尾
elif wxid.endswith('@chatroom'):
self._group_contacts[wxid] = nickname
# 确保群ID在字典中存在
if wxid not in self._group_contacts_friends:
self._group_contacts_friends[wxid] = {}
# 获取群成员信息:
for friend in self._group_members:
if friend.get('chatroom_id') == wxid:
@@ -241,7 +244,10 @@ class ContactManager:
self._official_accounts[wxid] = nickname
elif wxid.endswith('@chatroom'):
self._group_contacts[wxid] = nickname
# 需要获取群成员昵称信息; 从数据库里面提取。
# 确保群ID在字典中存在
if wxid not in self._group_contacts_friends:
self._group_contacts_friends[wxid] = {}
# 获取群成员信息:
for friend in self._group_members:
if friend.get('chatroom_id') == wxid:
self._group_contacts_friends[wxid].update(