Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wong2 committed Jan 14, 2013
1 parent 86bec8e commit 54c6581
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 7 additions & 2 deletions controller.py
Expand Up @@ -104,7 +104,12 @@ def getNotiData(bot, data):
'author_name': data['from_name'],
'reply_id': data['replied_id']
})
content = data['reply_content']

if ntype == NTYPES['reply_in_status_comment']:
content = data['reply_content']
else:
content = data['doing_content']

content_s = content.split(u'\uff1a', 1)
if len(content_s) == 1:
content_s = content.split(': ', 1)
Expand All @@ -126,7 +131,7 @@ def reply(data):
return

# 不要自问自答
if 'author_name' in data and '小黄鸡' in data['author_name'].encode('utf-8'):
if '小黄鸡' in data.get('author_name', u'').encode('utf-8'):
return

print 'handling comment', data, '\n'
Expand Down
1 change: 0 additions & 1 deletion main.py
Expand Up @@ -53,7 +53,6 @@ def handle(bot, notification):
# 得到人人上的通知,处理之
def process(bot, just_clear=False):
notifications = bot.getNotifications()
print notifications

for notification in notifications:
notify_id = notification['notify_id']
Expand Down

0 comments on commit 54c6581

Please sign in to comment.