We need fields like 'url_template' to do the code extraction.
Those are absent if 'playground_info' is undefined, thus we should
return immediately in those cases.
The 'playground_url' field is specialized to the 'else' block ,
but is being written into global 'playground' object thus mutating
it.
To avoid this , we create a Map, with its values being objects
that contain all the fields (including playground_url) neccessary
to be passed into the template for rendering.
Instead of charging the customer using the attached payment
method and then creating the invoice, we create an invoice and
force an immediate payment for the invoice via the attached
payment method.
This is a preparatory commit. It adds an extra notification_event_type
to the Recipient type. This can be used to differentiate between
typing notifications and message edit typing notifications since
they send different events.
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.