This commit adds code to unset is_web_public and is_realm_public fields
on attachments when deactivating a stream as we do not want to allow
spectators to access them after the stream is deactivated.
This commit also adds a comment explaining why we don't use
do_change_stream_permission to set the privacy fields on deactivating
a stream.
Fixes#27634.
We did not unset is_realm_public field on attachements when unarchiving
streams, but we do unset is_web_public field. This commit adds code to
unset the is_realm_public field as well as we make the stream private
while unarchiving it.
This cache was only used in one place, which is infrequently
called (only when sending messages, or searching explicitly for a list
of users) and the overhead of maintaining the cache is not worth
trying to avoid the well-indexed lookup of the huddle.
This commit sets the 'message_type' to "stream" in the beginning
of the test to properly verify wildcard mentions typeahead for
stream messages.
Earlier, 'message_type' was set to "False", and the test was passing
falsely because in the 'broadcast_mentions' function, the 'else' block
gets executed for 'message_type' having a value of either
'stream' or 'False'.
```
if (compose_state.get_message_type() === "private") {
wildcard_string = $t({defaultMessage: "Notify recipients"});
} else {
wildcard_string = $t({defaultMessage: "Notify stream"});
wildcard_mention_array.push("stream");
}
```
We don't need to explicitly change the condition to:
```
else if (compose_state.get_message_type() === "stream")
```
because in practise, the 'message_type' is either set to 'stream'
or 'private' when the user types a message.
Only changing the 'message_type' in the test to simulate the
actual behaviour fulfils our purpose.
This should have been included in 5bddd8f.
Moves the 'process_initial_upgrade' function to the
'BillingSession' abstract class.
This refactoring will help in minimizing duplicate code while
supporting both realm and remote_server customers.
For more clarity, the 3 related functions `is_search` in `filter.js`,
`message_list.js` and `message_list_data.js` are all renamed to
`is_keyword_search`.
The message shown on successful invitation included "User(s)"
previously. This commit updates it to include "User" or "Users"
according to the number of users invited.
We now pass bogus data for inaccessible users when sending
the users data in "realm_users" field of "register" response
or when using endpoints like "GET /users" to get data of
all the users in realm.
We would add a client capability field in future commits
such that new clients would receive data only for accessible
users and they can form the bogus data by themselves.
This commit adds new setting for controlling who can access
all users in the realm which would have "Everyone" and
"Members only" option.
Fixes part of #10970.
Previously, the "All messages" typeahead would be shown whenever
the search bar had an empty input. This change removes that typeahead
completely in favor of using other filters such as -is:muted.
Fixes#27358
Co-authored-by: Heran Zhang & Wei-Cheng Sung
This is a CountStat for tracking how many mobile notifications the
server requested.
1. On a self-hosted server, that means requesting from the push bouncer.
2. On a server that's its own push bouncer, that's just the number
directly sent.
This number has room for inaccuracy due to incrementing by the number of
user devices on a self-hosted server, as it doesn't account for errors
that may occur in the GCM/APNs low-level sending codepaths on the bouncer.
Also tests that a server that's its own push bouncer correctly
increments its mobile_pushes_sent::day CountStat, by basing it on the
values returned from the send_apple/android_push_notification functions
which tell us the actual number of successfully sent notifications.
Since the return values of send_..._push_notification are now
used in those codepaths, we need to tweak our mocks in some unrelated
tests to set up some return value to avoid errors.
Turndown would strip `<style>` tags, but retain the content enclosed.
This resulted in unwanted content being pasted, like the comment nodes
inside the `<style>` tag when pasting cell/s copied from Google Sheets.
We usually default to pasting formatted markdown (unless the Shift key
is used to paste plainly instead), but when we're inside a code block,
we always want to paste plainly.
This is a prep commit for the following 2 commits, so we can opt out of
the formatted paste and automatic bulleting / numbering behaviors when
inside a code block.
When navigating to the next unread followed topic using
the Shift+N hotkey, we notify the user when there are no more
unread messages in followed topics.
Earlier, the hotkey simply did nothing in such a case.
We use feedback_widget to do so.
Fixes#27604.
It is common for users in other chat tools to start off a direct message
with @ mentioning the addressee. However, this results in potentially
unexpected behavior in Zulip, where the message is highlighted and shows
up in @ mentions in addition to DMs. We want to prevent this behaviour by
automatically changing the @ mentions to silent @ mentions for the user.
These changes only apply to 1:1 DMs and not group chats.
Fixes: #17998.
Updates `process_initial_upgrade` to take a plan_tier parameter,
so that information can be specific to the type of BillingSession.
Note that ideally the plan tier would be passed as metadata to the
stripe.checkout.Session, but in order to do so, we need to be able
to update the generated stripe fixtures for tests. So for now, we
set the plan tier directly in the stripe event handler code.
Instead of hard coding the string for the stripe.InvoiceItem and
stripe.Invoice statement_descriptor, we use the name of the plan
that was just created.