Mark messages from the desktop app as sent_by_human

(imported from commit 001073221387cbbaa541b17f9a377490562a28f1)
This commit is contained in:
Leo Franchi 2013-09-04 11:00:11 -04:00
parent fdc589de3a
commit 7e6af0a5d0
1 changed files with 3 additions and 2 deletions

View File

@ -271,8 +271,9 @@ def do_send_messages(messages):
mentioned_ids = message['message'].mentions_user_ids mentioned_ids = message['message'].mentions_user_ids
for um in ums_to_create: for um in ums_to_create:
sent_by_human = message['message'].sending_client.name.lower() in \ sent_by_human = (message['message'].sending_client.name.lower() in \
['website', 'iphone', 'android'] ['website', 'iphone', 'android']) or \
('desktop app' in message['message'].sending_client.name.lower())
if um.user_profile.id == message['message'].sender.id and sent_by_human: if um.user_profile.id == message['message'].sender.id and sent_by_human:
um.flags |= UserMessage.flags.read um.flags |= UserMessage.flags.read
if wildcard: if wildcard: