mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
notifications: Collapse blockquotes and "user said" paragraphs.
Since notifications have limited space for the contents of a message, a quote from a previous message, or elsewhere, can take up most of the notification, leaving little room for the actual message, and reducing the usefulness of the notification. To fix this, we collapse blockquotes and "user said" paragraphs to make space for the actual message.
This commit is contained in:
@@ -34,6 +34,18 @@ export function get_current_hash_section(): string {
|
||||
return get_hash_section(window.location.hash);
|
||||
}
|
||||
|
||||
export function is_same_server_message_link(url: string): boolean {
|
||||
// A same server message link always has category `narrow`,
|
||||
// section `stream` or `dm`, and ends with `/near/<message_id>`,
|
||||
// where <message_id> is a sequence of digits.
|
||||
return (
|
||||
get_hash_category(url) === "narrow" &&
|
||||
(get_hash_section(url) === "stream" || get_hash_section(url) === "dm") &&
|
||||
get_nth_hash_section(url, -2) === "near" &&
|
||||
/^\d+$/.test(get_nth_hash_section(url, -1))
|
||||
);
|
||||
}
|
||||
|
||||
export function is_overlay_hash(hash: string): boolean {
|
||||
// Hash changes within this list are overlays and should not unnarrow (etc.)
|
||||
const overlay_list = [
|
||||
|
||||
Reference in New Issue
Block a user