优化联系人信息,解决总结时使用了其他群的备注信息
This commit is contained in:
@@ -185,7 +185,8 @@ class Robot:
|
||||
self.allContacts = self.get_all_contacts()
|
||||
friends = await self.ipad_bot.get_contract_list()
|
||||
self.head_images = self.get_all_head_images()
|
||||
self.contact_manager.set_contacts(self.allContacts, friends, self.head_images)
|
||||
self.all_chatroom_members = self.contacts_db.get_chatroom_member_list_name_all()
|
||||
self.contact_manager.set_contacts(self.allContacts, friends, self.head_images, self.all_chatroom_members)
|
||||
|
||||
self.message_storage = MessageStorage(self.ipad_bot)
|
||||
|
||||
@@ -361,10 +362,6 @@ class Robot:
|
||||
try:
|
||||
# self.LOG.debug(f"message: {message}")
|
||||
# 消息已经是WxMessage对象,直接使用其属性和方法
|
||||
from_user = message.sender
|
||||
to_user = message.to_user
|
||||
content = message.content
|
||||
msg_type = message.msg_type
|
||||
|
||||
# 判断是否为群消息
|
||||
is_group = message.from_group()
|
||||
@@ -409,7 +406,9 @@ class Robot:
|
||||
self.head_images[wxid] = small_head_img_url
|
||||
|
||||
friends = await self.ipad_bot.get_contract_list()
|
||||
self.contact_manager.set_contacts(self.allContacts, friends, self.head_images)
|
||||
self.all_chatroom_members = self.contacts_db.get_chatroom_member_list_name_all()
|
||||
self.contact_manager.set_contacts(self.allContacts, friends, self.head_images,
|
||||
self.all_chatroom_members)
|
||||
self.LOG.info(f"已更新群 {group_id} 的成员信息")
|
||||
except Exception as e:
|
||||
self.LOG.error(f"获取群成员信息失败: {e}")
|
||||
@@ -459,7 +458,7 @@ class Robot:
|
||||
"""刷新联系人信息"""
|
||||
self.allContacts = self.get_all_contacts()
|
||||
friends = await self.ipad_bot.get_contract_list()
|
||||
self.contact_manager.refresh_contacts(self.allContacts,friends)
|
||||
self.contact_manager.refresh_contacts(self.allContacts, friends)
|
||||
self.LOG.info("联系人信息已刷新")
|
||||
|
||||
async def send_group_txt_message(self, msg: str, feature: Feature):
|
||||
@@ -609,8 +608,11 @@ class Robot:
|
||||
self.allContacts[wxid] = nick_name
|
||||
|
||||
self.head_images[wxid] = small_head_img_url
|
||||
friends = await self.ipad_bot.get_contract_list()
|
||||
self.contact_manager.set_contacts(self.allContacts, friends, self.head_images)
|
||||
friends = await self.ipad_bot.get_contractlist()
|
||||
|
||||
self.all_chatroom_members = self.contacts_db.get_chatroom_member_list_name_all()
|
||||
self.contact_manager.set_contacts(self.allContacts, friends, self.head_images,
|
||||
self.all_chatroom_members)
|
||||
self.LOG.info(f"已更新群 {group_id} 的成员信息")
|
||||
else:
|
||||
self.LOG.error(f"获取群 {group_id} 信息失败,证明用户无该群信息,删除群的相关资料。")
|
||||
|
||||
Reference in New Issue
Block a user