Previously, when sending messages to resolved topics, the warning
suggesting to resolve that topic used wrong check to verify if the
user is allowed to resolve the topic. This commit fixes that.
Work towards #34244
This is the only call to `peer_data.is_subscriber_subset`, so after
this commit all calls to that function work with our new model for
partial subscriber data.
Opening settings and stream settings UI was not working for guests
if they could not access all users. This was because is_person_active
did not handle inaccessible users correctly, if they were not added in
the users data, when being called in get_group_members to render
group pills.
Earlier, with `realm_mandatory_topics=true` the topic required
error message was shown only when topic="".
The error message was missing for other topic names which are
also considered empty:
* "(no topic)"
* realm_empty_topic_display_name
This commit fixes the bug to show the error message for the
other two topic names too.
When I adjusted 4fbf91c135 to no longer
do a full re-validation on every character typed, that unmasked bugs
in how the compose_setup handler code and compose_validate split
responsibility for validating 0-length messages.
The user-facing result was the send button not enabling properly when
starting to type.
Fix this by moving the 0-length message validation into
compose_validate, where we already handle issues of too-long messages,
sharing the same basic logic for determining when to do a full
validate() call.
A benefit of this reworking is now all of the logic for handling the
`invalid` class is in one place in validate, rather than split with
the compose_setup module.
Compose send tooltip was not correctly displayed when the compose
box was in an invalid state.
We significanlty improve the logic for displaying the tooltip here
to provide a more robust experience to the user.
Added `enable_guest_user_dm_warning` setting to decide whether
clients should show a warning when a user is composing to a guest
user in the organization.
Fixes#30078.
Co-authored-by: adnan-td <generaladnan139@gmail.com>
We are using `can_add_subscribers_group` instead of
`invite_to_stream_policy` to check whether a user can subscribe other
users.
We've removed `invite_to_stream_policy` from the frontend wherever
applicable.
Previously, the client tweaked messages sent in a channel with
an empty topic box to use the topic "(no topic)".
This commit updates the behavior to stop applying that tweak.
Messages will now be sent with an empty string as the topic
as we now support the empty string as a valid topic name.
This commit simplifies a compose_validate test by
using FakeComposeBox.
It also exposes $send_message_form to the callers.
(The general idea here is that for any individual
test, we don't want the developer to have to
switch between thinking about low-level zjquery
idioms and higher-level abstractions.)
This commit also removes the use of mock_template,
since the template in question generates trivially
easy html to deal with (and we verify the actual
effects to the DOM).
Refactors `check_overflow_text` and `validate_message_length` functions.
This commit ensures that there won't be any change in the existing UI
of the compose box with the refactoring of the above functions.