|
|
@@ -86,7 +86,7 @@ def fetch_and_save_contacts2(): |
|
|
|
#time.sleep(60*10) |
|
|
|
time.sleep(3600*1) |
|
|
|
|
|
|
|
def auto_contacts_from_chatroom(): |
|
|
|
def auto_add_contacts_from_chatrooms(): |
|
|
|
logger.info('自动从群添加好友') |
|
|
|
wxchat=gewe_chat.wxchat |
|
|
|
while True: |
|
|
@@ -105,14 +105,14 @@ def auto_contacts_from_chatroom(): |
|
|
|
status=r.get('status') |
|
|
|
|
|
|
|
# 启动线程处理登录信息 |
|
|
|
thread = threading.Thread(target=process_add_contacts_from_groups, args=(wxchat,status, nickname, wxid, token_id, app_id)) |
|
|
|
thread = threading.Thread(target=process_add_contacts_from_chatrooms, args=(wxchat,status, nickname, wxid, token_id, app_id)) |
|
|
|
thread.start() |
|
|
|
time.sleep(3) |
|
|
|
|
|
|
|
#time.sleep(60*10) |
|
|
|
time.sleep(3600*24) |
|
|
|
|
|
|
|
def process_add_contacts_from_groups(wxchat:gewe_chat.GeWeChatCom,status, nickname, wxid, token_id, app_id): |
|
|
|
def process_add_contacts_from_chatrooms(wxchat:gewe_chat.GeWeChatCom,status, nickname, wxid, token_id, app_id): |
|
|
|
|
|
|
|
if status == '1': |
|
|
|
c = wxchat.get_wxchat_config_from_cache(wxid) |
|
|
@@ -151,7 +151,7 @@ def start_wxchat_thread(): |
|
|
|
scan_wx_login_info() |
|
|
|
# 启动同步联系人线程 |
|
|
|
threading.Thread(target=fetch_and_save_contacts2).start() |
|
|
|
threading.Thread(target=auto_contacts_from_chatroom).start() |
|
|
|
threading.Thread(target=auto_add_contacts_from_chatrooms).start() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|