read_receipts: Add support for displaying read receipts.

Adds an API endpoint for accessing read receipts for other users, as
well as a modal UI for displaying that information.

Enables the previously merged privacy settings UI for managing whether
a user makes read receipts data available to other users.

Documentation is pending, and we'll likely want to link to the
documentation with help_settings_link once it is complete.

Fixes #3618.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
This commit is contained in:
Dinesh
2021-06-17 00:45:47 +05:30
committed by Tim Abbott
parent 5bd1a85659
commit 48d2783559
23 changed files with 663 additions and 3 deletions

View File

@@ -1015,6 +1015,15 @@ def remove_reaction(client: Client, message_id: int) -> None:
validate_against_openapi_schema(result, "/messages/{message_id}/reactions", "delete", "200")
@openapi_test_function("/messages/{message_id}/read_receipts:get")
def get_read_receipts(client: Client, message_id: int) -> None:
# {code_example|start}
# Get read receipts for a message
result = client.call_endpoint(f"/messages/{message_id}/read_receipts", method="GET")
# {code_example|end}
validate_against_openapi_schema(result, "/messages/{message_id}/read_receipts", "get", "200")
def test_nonexistent_stream_error(client: Client) -> None:
request = {
"type": "stream",
@@ -1498,6 +1507,7 @@ def test_messages(client: Client, nonadmin_client: Client) -> None:
get_messages(client)
check_messages_match_narrow(client)
get_message_history(client, message_id)
get_read_receipts(client, message_id)
delete_message(client, message_id)
mark_all_as_read(client)
mark_stream_as_read(client)