Correctly set read flag for messages sent by yourself.

Compare two user objects by id to prevent false negatives
when the objects are fetched thru different paths.

(imported from commit a41f30d27e2b8021600d89f32d6526f48677fd95)
This commit is contained in:
Steve Howell 2013-06-26 08:05:22 -04:00
parent 343023d2de
commit e904dbc19c
1 changed files with 1 additions and 1 deletions

View File

@ -283,7 +283,7 @@ def do_send_messages(messages):
for um in ums_to_create:
sent_by_human = message['message'].sending_client.name.lower() in \
['website', 'iphone', 'android']
if um.user_profile == message['message'].sender and sent_by_human:
if um.user_profile.id == message['message'].sender.id and sent_by_human:
um.flags |= UserMessage.flags.read
if wildcard:
um.flags |= UserMessage.flags.wildcard_mentioned