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.
Since we allow calling `add_messages` without checking fetch status,
it can lead to non-contiguous message history due to latest message
being added to a message list without previous messages being
fetched.
To fix it, we only allow adding new messages via message_fetch
which properly sets `anchor` to the last message in the list
before fetching and adding messages to the list.
We update the fetch status before reaching here, so it was
incorrect to return before adding messages to the message
list data since it is always cached.
Since the initial fetch has a lot of messages, it can add many topics
to the left sidebar which can move the selected topic out of the view.
Note that `has_scrolled` is triggered even for the scrolls not triggered
by user since it is not easy to differentiate between the two events.
So, it is okay to ignore it initially.
If the initial fetch for the narrow didn't return enough data for
the view to becomes scrollable, we should try to populate the narrow
with more messages.
Since `all_messages_data` is no longer the data for combined feed,
we need to treat combined feed like any other view and continue
fetching messages if required.
`Filter.public_terms` will return the same result even if the
narrow is combined feed. Since we are no longer passing
empty narrow parameters for combined feed, this condition is
not required.
The operand for the canoncial "channel" operator can be an ID, but
it must be an integer and not a string, so we take care of that
directly in handle_operators_supporting_id_based_api.