mirror of https://github.com/zulip/zulip.git
Turn 2-person huddles between the sender and other user into a personal on the backend
(imported from commit 959e7ea8101dc1d469d62ea2c7c7a65854679833)
This commit is contained in:
parent
195bdb07c9
commit
f851d9437d
|
@ -588,6 +588,13 @@ def send_message_backend(request, user_profile, sender, message_type_name = POST
|
|||
recipient_profile_ids.add(UserProfile.objects.get(user__email=recipient).id)
|
||||
except UserProfile.DoesNotExist:
|
||||
return json_error("Invalid email '%s'" % (recipient,))
|
||||
|
||||
# If the private message is just between the sender and
|
||||
# another person, force it to be a personal internally
|
||||
if (len(recipient_profile_ids) == 2
|
||||
and user_profile.id in recipient_profile_ids):
|
||||
recipient_profile_ids.remove(user_profile.id)
|
||||
|
||||
if len(recipient_profile_ids) > 1:
|
||||
# Make sure the sender is included in huddle messages
|
||||
recipient_profile_ids.add(sender.id)
|
||||
|
|
Loading…
Reference in New Issue