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.
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.
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
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.
Rename the existing 'wildcard_mentioned' flag to
'stream_wildcard_mentioned'.
The 'wildcard_mentioned' flag is deprecated and exists for
backwards compatibility.
We have two separate flags for stream and topic wildcard mentions,
i.e., 'stream_wildcard_mentioned' and 'topic_wildcard_mentioned',
respectively.
* stream wildcard mentions: `@all`, `@everyone`, and `@stream`
* topic wildcard mentions: `@topic`
The `wildcard_mentioned` flag is included in the events and
API response if either `stream_wildcard_mentioned` or
`topic_wildcard_mentioned` is set.
This commit addresses the issue where scheduling a message for a
time less than 5 minutes in the future resulted in the confirmation
banner not displaying the scheduled time, which should have actually
been 5 minutes in the future, as enforced at the UI level by the
MINIMUM_SCHEDULED_MESSAGE_DELAY_SECONDS variable.
We remove the `is_send_later_timestamp_missing_or_expired` method along
with it's tests since `selected_send_later_timestamp` is already set to
the minimum of 5 minutes in the future through the `minDate` option of
the flatpickr.
Fixes: #26784.
Co-authored-by: Sayam Samal <samal.sayam@gmail.com>
Fixes#27489
For sticky message headers, we should not use the `first_message_in_group`
for narrowing to the topic since can be out of view for the user.
Presently in a session when an image or video title is updated,
the same change is not reflected in the lightbox view of
them, until a new session is made.
This is because the metadata of the media is stored in Map
for the session with the preview_src as keys, and hence,
when title is changed the preview_src being same, the title
change is not reflected inside lightbox view.
This is fixed by modifing the asset_map (cache map) keys
from preview_src to an array of preview_src, and the media
title. Hence, when title is modified now, the keys won't map
to the existing value, and hence new metadata would be
shown.
A new function get_asset_map_key_for_media() introduced
to get the corresponing metadata from this asset_map
by passing in the prview_src and media elements.
Fixes#21311
Bug reported here:
https://chat.zulip.org/#narrow/stream/464-kandra-js-errors/topic/Error.3A.20The.20partial.20.40partial-block.20could.20not.20be.20found/near/1673466
The reported issue was for a message edit request, and it was
happening because `channel.xhr_error_message` can return the
empty string sometimes, and `render_compose_banner` shows the
banner text if it exists and otherwise tries to render a
`@partial-block`. Unfortunately the empty string acts as falsy
in the template, leading to the partial block error.
This commit adds a default error message that was removed
in 96680e95fb.
It also adds a check to not show an error banner at all if
`readyState` is 0, which means the request was cancelled.