Skip to content

Commit

Permalink
Update objects.py
Browse files Browse the repository at this point in the history
腾讯更新了webqq的好友列表,新的返回值里面有一个实际不存在的虚假好友,会导致map的key不正确。
  • Loading branch information
tempdban committed Aug 4, 2014
1 parent 795a898 commit 1589d26
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions twqq/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,11 @@ def update(self, data):

for item in data.get("marknames", []):
uin = item.get("uin")
self._uin_map[uin].set_markname(item.get("markname"))
self._mark_uin_map[item.get("markname")] = uin
try:
self._uin_map[uin].set_markname(item.get("markname"))
self._mark_uin_map[item.get("markname")] = uin
except KeyError:
pass

for item in data.get("vipinfo", []):
uin = item.get("u")
Expand Down

0 comments on commit 1589d26

Please sign in to comment.