Skip to content

Commit

Permalink
Processing messages from oldest to newest
Browse files Browse the repository at this point in the history
  • Loading branch information
vindimy committed Dec 8, 2013
1 parent e363791 commit fe4e8bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/cointipbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ def check_inbox(self):
try:

# Try to fetch some messages
messages = ctb_misc.praw_call(self.reddit.get_unread, limit=self.conf.reddit.scan.batch_limit)
messages = list(ctb_misc.praw_call(self.reddit.get_unread, limit=self.conf.reddit.scan.batch_limit))
messages.reverse()

# Process messages
for m in messages:
Expand Down
4 changes: 2 additions & 2 deletions src/ctb/ctb_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ def update_user_stats(ctb=None, username=None):
num_received = 0
for m in history:
if m['state'] == 'completed':
if m['from_user'] == username:
if m['from_user'].lower() == username.lower():
num_tipped += 1
elif m['to_user'] == username:
elif m['to_user'].lower() == username.lower():
num_received += 1
values = []
for k in history.keys():
Expand Down

0 comments on commit fe4e8bf

Please sign in to comment.