web: Add parameters to API requests for empty topic name support.

This commit adds `allow_empty_name: true` to the following
endpoints to receive empty strings as topic name when such
topics are available:
* `GET /messages`
* `GET /messages/{message_id}`
* `GET /messages/{message_id}/history`

Also, it adds `empty_topic_name` client capability for spectators.

These changes are part of the broader effort to enable
support for empty string as a topic name.
This commit is contained in:
Prakhar Pratyush
2025-01-08 20:29:19 +05:30
committed by Tim Abbott
parent 593bd5f757
commit fd67e31163
12 changed files with 19 additions and 1 deletions

View File

@@ -59,6 +59,7 @@ type MessageFetchAPIParams = {
num_after: number;
client_gravatar: boolean;
narrow?: string;
allow_empty_topic_name: boolean;
};
let first_messages_fetch = true;
@@ -329,6 +330,7 @@ function get_parameters_for_message_fetch_api(opts: MessageFetchOptions): Messag
num_before: opts.num_before,
num_after: opts.num_after,
client_gravatar: true,
allow_empty_topic_name: true,
};
const msg_list_data = opts.msg_list_data;