Don't mark your message as read if it comes from the API

(imported from commit 0570d4db590e21b0fadd544b10c9865fa7acd66b)
This commit is contained in:
Leo Franchi
2013-03-14 14:55:44 -04:00
parent 95c9c6817f
commit 07433b80cc
2 changed files with 7 additions and 2 deletions

View File

@@ -154,7 +154,9 @@ def do_send_message(message, rendered_content=None, no_log=False):
for user_profile in recipients
if user_profile.user.is_active]
for um in ums_to_create:
if um.user_profile == message.sender:
sent_by_human = message.sending_client.name.lower() in \
['website', 'iphone', 'android']
if um.user_profile == message.sender and sent_by_human:
um.flags |= UserMessage.flags.read
batch_bulk_create(UserMessage, ums_to_create)