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

When using direct message groups as the preferred method for 1:1 or
self-messages, the get_recipient_ids function should include the
user ID for self-messages. Without this, the UI cannot detect who
was the recipient of the message.
This commit is contained in:
Mohammad Reza Kianifar
2025-08-17 04:12:45 +00:00
committed by Tim Abbott
parent 2671aff7c3
commit e2d1c233ba

View File

@@ -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