This is a preparatory commit that refactors the check_update_message
method to extract the checks containing whether a user can edit the
message or not into a separate method -validate_message_content_edit,
so that it can be re used later.
This commit extracts the edited notice computation logic of
edited_in_left_col, edited_alongside_sender and edited_status_message
to a new function - set_edited_notice_locations and calls it right
after the method merge_message_groups.
This is a preparatory commit, and is done since theses three variables
were previously wrongly initialized in the beginning for live messages
received.
We also introduce a modified flag to decide whether to display the
edited notice or not. This is useful since now we are computing
the edited notice values even when messages are not edited, and
hence we show the notices only when the modified flag is true.
The function body contains only two conditionals, so the
'switch' statements can be replaced with simple 'if's that
return immediately, thus making the code block cleaner.
Earlier, we were not setting `free_trial` = False for legacy
customers in `do_upgrade`.
This lead to a bug where customers were upgraded even before the
payment was complete. 'process_initial_upgrade' was always getting
called instead of 'setup_upgrade_payment_intent_and_charge'.
This commit fixes the incorrect behaviour.
This logic was part of the original desktop notifications
implementation in 4cb0c6225e.
There's no apparent standard for the number of characters allowed to
be shown in a desktop notification, so truncating at 150 characters
arbitrarily seems wrong.
Further, we've decided it's no longer a priority to truncate at word
boundaries, we can rely on the browser to take responsibility for
truncation.
Fixes#25260.
- Updates incoming webhooks overview and walkthrough to be consistent
with the `zerver/webhooks/` codebase.
- Tweaks the documentation for better readability.
Refactoring to avoid duplication, improve readability, and standardize
deselection logic by converting calls to remove to
deselect_top_left_corner_items.
This logic was apparently missed when we implemented private streams
with shared history; the correct check is to look at whether the user
can access message history in the stream, which used to be equivalent
to whether it's a private stream.
The proposed_val for "realm_can_access_all_users_group" setting
was always returning NaN value which resulted in the value
being included in request even when it was not changed or disabled
due to org not being on "Plus" plan. This resulted in a bug where
user was not allowed to change the "guest" indicator setting
on orgs without "Plus" plan.
For orgs with "Plus" plan there was no problem in changing the
setting but the save button was visible incorrectly if the setting
was set to the initial value.
This commit fixes both the bugs.
The "Who can access all users" setting is not disabled for
organizations not on "Plus" plans in production because of
the "page_params.development_environment" check.
We do not need that check anymore as the feature is now
enabled in production.