Merge pull request #125 from jseagull/master

fix exception when message contains :<br/>
This commit is contained in:
Urinx
2016-11-19 00:37:17 +08:00
committed by GitHub
+3 -3
View File
@@ -281,7 +281,7 @@ class WebWeixin(object):
elif Contact['UserName'] in SpecialUsers: # 特殊账号 elif Contact['UserName'] in SpecialUsers: # 特殊账号
ContactList.remove(Contact) ContactList.remove(Contact)
self.SpecialUsersList.append(Contact) self.SpecialUsersList.append(Contact)
elif Contact['UserName'].find('@@') != -1: # 群聊 elif '@@' in Contact['UserName']: # 群聊
ContactList.remove(Contact) ContactList.remove(Contact)
self.GroupList.append(Contact) self.GroupList.append(Contact)
elif Contact['UserName'] == self.User['UserName']: # 自己 elif Contact['UserName'] == self.User['UserName']: # 自己
@@ -696,8 +696,8 @@ class WebWeixin(object):
if msg['raw_msg']['FromUserName'][:2] == '@@': if msg['raw_msg']['FromUserName'][:2] == '@@':
# 接收到来自群的消息 # 接收到来自群的消息
if re.search(":<br/>", content, re.IGNORECASE): if ":<br/>" in content:
[people, content] = content.split(':<br/>') [people, content] = content.split(':<br/>', 1)
groupName = srcName groupName = srcName
srcName = self.getUserRemarkName(people) srcName = self.getUserRemarkName(people)
dstName = 'GROUP' dstName = 'GROUP'