Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

get_recipient_ids: Include user ID for self-messages using DM group.

Mohammad Reza Kianifare2d1c233ba55
diff --git a/zerver/lib/display_recipient.py b/zerver/lib/display_recipient.py
index 976af4c5e8a..38f201060f9 100644
--- a/zerver/lib/display_recipient.py
+++ b/zerver/lib/display_recipient.py
@@ -249,8 +249,9 @@ def get_recipient_ids(
to = [recipient.type_id]
else:
to = []
- for r in get_display_recipient(recipient):
+ recipients = get_display_recipient(recipient)
+ for r in recipients:
assert not isinstance(r, str) # It will only be a string for streams
- if r["id"] != user_profile_id:
+ if r["id"] != user_profile_id or len(recipients) == 1:
to.append(r["id"])
return to, recipient_type_str