提交 2f1ffe20 编写于 作者: L LittleCoder

Fix contact spelling bug & fix None assignment bug [BR#226: cubesky]

上级 d42f0f46
......@@ -125,7 +125,7 @@ itchat.auto_login(enableCmdQR=-1)
获取微信的所有好友信息并更新。
* 方法名称:`get_friends`(曾用名:`get_contract`
* 方法名称:`get_friends`(曾用名:`get_contact`
* 所需值:无
* 返回值:存储好友信息的列表
......
......@@ -236,7 +236,13 @@ def update_local_uin(core, msg):
update_friend(core, username)
newFriendDict = utils.search_dict_list(
core.memberList, 'UserName', username)
newFriendDict['Uin'] = uin
if newFriendDict is None:
newFriendDict = utils.struct_friend_info({
'UserName': username,
'Uin': uin, })
core.memberList.append(newFriendDict)
else:
newFriendDict['Uin'] = uin
usernameChangedList.append(username)
logger.debug('Uin fetched: %s, %s' % (username, uin))
else:
......
import os, platform
VERSION = '1.2.25'
VERSION = '1.2.26'
BASE_URL = 'https://login.weixin.qq.com'
OS = platform.system() #Windows, Linux, Darwin
DIR = os.getcwd()
......
......@@ -46,20 +46,20 @@ class Storage(object):
for k in ('RemarkName', 'NickName', 'Alias'):
if matchDict[k] is None: del matchDict[k]
if name: # select based on name
contract = []
contact = []
for m in self.memberList:
if any([m.get(k) == name for k in ('RemarkName', 'NickName', 'Alias')]):
contract.append(m)
contact.append(m)
else:
contract = self.memberList[:]
contact = self.memberList[:]
if matchDict: # select again based on matchDict
friendList = []
for m in contract:
for m in contact:
if all([m.get(k) == v for k, v in matchDict.items()]):
friendList.append(m)
return copy.deepcopy(friendList)
else:
return copy.deepcopy(contract)
return copy.deepcopy(contact)
def search_chatrooms(self, name=None, userName=None):
if userName is not None:
for m in self.chatroomList:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册