gateway: make private_channels v9-compliant

This commit is contained in:
Luna 2021-08-31 00:18:16 -03:00
parent f5922db52f
commit 56b6b8665f
1 changed files with 15 additions and 0 deletions

View File

@ -111,6 +111,21 @@ def _complete_users_list(user_id: str, base_ready, user_ready, ws_properties) ->
}
)
ready["private_channels"] = []
for private_channel in base_ready["private_channels"]:
ready["private_channels"].append(
{
"id": private_channel["id"],
"type": private_channel["type"],
"last_message_id": private_channel["last_message_id"],
"recipient_ids": [
recipient["id"] for recipient in private_channel["recipients"]
],
# TODO implement last_pin_timestamp here
# "last_pin_timestamp": "2020-03-30T00:00:00.888000+00:00",
},
)
return ready, users_to_send