浏览代码

调整

develop
H Vs 2 个月前
父节点
当前提交
4f9f9096aa
共有 1 个文件被更改,包括 13 次插入3 次删除
  1. +13
    -3
      resources/messages_resource.py

+ 13
- 3
resources/messages_resource.py 查看文件

@@ -98,7 +98,12 @@ class MessagesResource(Resource):
''' '''
wxid = msg.get("Wxid") wxid = msg.get("Wxid")
msg_data = msg.get("Data") msg_data = msg.get("Data")
handle_mod_contacts(token_id,app_id,wxid,msg_data)
#
#handle_mod_contacts(token_id,app_id,wxid,msg_data)
#
threading.Thread(target=handle_mod_contacts, args=(token_id,app_id,wxid,msg_data)).start()

elif type_name=="DelContacts": elif type_name=="DelContacts":
''' '''
删除好友通知/退出群聊 删除好友通知/退出群聊
@@ -774,9 +779,14 @@ def handle_mod_contacts(token_id,app_id,wxid,msg_data):




ret,msg,contacts_list = gewe_chat.wxchat.fetch_contacts_list(token_id, app_id) ret,msg,contacts_list = gewe_chat.wxchat.fetch_contacts_list(token_id, app_id)
friend_wxids = contacts_list['friends'][3:] # 可以调整截取范围
print(friend_wxids)
# friend_wxids = contacts_list['friends'][3:] # 可以调整截取范围
# print(friend_wxids)
#friend_wxids.remove('fmessage')
#friend_wxids.remove('weixin') #friend_wxids.remove('weixin')

friend_wxids = [c for c in contacts_list['friends'] if c not in ['fmessage', 'medianote','weixin']] # 可以调整截取范围
print(f'{wxid}的好友数量{len(friend_wxids)}')
gewe_chat.wxchat.save_contacts_brief_to_cache(token_id, app_id, wxid, friend_wxids) gewe_chat.wxchat.save_contacts_brief_to_cache(token_id, app_id, wxid, friend_wxids)
else: else:


正在加载...
取消
保存