Commit Graph

9472 Commits

Author SHA1 Message Date
PieterCK
c460dc3c9c url_encoding: Update encode_stream -> encode_channel. 2025-07-03 14:40:49 -07:00
Rohan Gudimetla
8e0ba8cccf topics: Server generated permalinks now prefer latest message id.
Previously, when a topic is mentioned, the server generated a
permalink using the earliest accessible message of the topic.

This commit updates it to rather use the latest message of the
topic.
2025-07-03 11:06:39 -07:00
Aman Agrawal
5a65bd4746 reminders: Fix poll and todo list not correctly formatted for reminder. 2025-07-02 13:02:53 -07:00
Aman Agrawal
25731859b6 zerver: Add endpoints and events for reminders.
There are similar to what exists for scheduled messages expect
the PATCH requests which will be added later when the
functionality is implemented.
2025-07-02 12:47:00 -07:00
Anders Kaseorg
08a17ef22d CVE-2025-52559: Generate HTML for digest new channels safely.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-07-02 12:12:36 -07:00
Anders Kaseorg
a274170293 CVE-2025-52559: Generate HTML for digest message sender safely.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-07-02 12:12:36 -07:00
Anders Kaseorg
c33b6cae38 CVE-2025-52559: Generate HTML for digest recipient header safely.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-07-02 12:12:36 -07:00
Vector73
459b4867f2 tools: Add support for viewing updated changelog for testing.
Adds support for showing unmerged changelogs in
"changelog.md" for testing purposes.
2025-07-02 11:34:34 -07:00
Alex Vandiver
8cde0af040 email_mirror: Fail more gracefully on empty EMAIL_GATEWAY_PATTERN.
Otherwise, this fails on `match.group(1)` as there is no match group.

The server would ideally respond with a 521 or 556 code[^1] on initial
connection, but aiosmtpd does not provide that option.

[^1]: https://www.rfc-editor.org/rfc/rfc7504
2025-07-02 10:21:08 -07:00
Evy Kassirer
0c5e1ac492 subscription_data: Flesh out partial suscription data sent to client.
Part of #34244.
2025-06-30 17:10:36 -07:00
Shubham Padia
d701fec37d markdown: Show inline video previews for dropbox videos.
Fixes https://chat.zulip.org/#narrow/channel/9-issues/topic/.F0.9F.93.82.20video.20preview.20not.20working.20.28Dropbox.29
2025-06-30 11:21:32 -07:00
Shubham Padia
276bc7284f markdown: Rename dropbox_image to dropbox_media.
We are adding video support to the function in upcoming commits and we
need to rename the function for that to be more generic.
We've also added a proper return type in the name of DropboxMediaInfo
TypedDict for the `dropbox_media` function.
2025-06-30 11:21:32 -07:00
Kislay Verma
1588b72e60 email_notifications: Use with and near operators when applicable.
We currently don't use either of those operators in email
topic links, which breaks the links on topic moves.

Quoting Tim for choosing `near` vs `with`:
"I guess for each case we should decide if we want /near/ links
to /with/ links. We likely want /with/ in some cases, to make
sure we land in the right conversation but not forcing the scroll
position to be on that particular message, which /near/ does."

"I feel like email notifications might want /near/ if the trigger
is a mention or something else that is specific to the message,
rather than the conversation, but probably /with/ otherwise."
2025-06-30 11:19:00 -07:00
Kislay Verma
6bd6f23549 url_encoding: Add support for with message links.
We abstract away "near" vs "with" from the function names and
allow callers to specify whether they want a conversation_link,
ie, use the "with" operator. The default choice is "near".
2025-06-30 11:19:00 -07:00
Shubham Padia
a0deeae80e help-beta: Introduce NavigationSteps component for settings links.
Fixes #31254.
We are using `SHOW_RELATIVE_LINKS` as the env variable to set if we
want to show relative settings link or non-linked markdown instructions.
We are not trying to determine `SHOW_SETTINGS_LINK` by ourselves. See
https://chat.zulip.org/#narrow/channel/49-development-help/topic/Passing.20sitename.20for.20astro.20project.20in.20production.2E
for more details.
Until the cutover happens, we would need to manually update the mapping
in both the astro component and the python file, but since that mapping
is not frequently changed, that is a tradeoff we can make.
We had to add margin-bottom: 0 to icon styling since starlight was
inserting a margin-bottom of 1.25 em for list items.
2025-06-26 10:46:37 -07:00
Kislay Verma
5f80f0a970 channel: Add option to notify users newly added to a channel.
When a user is added to a channel, we send
the user that was added a Notification Bot
DMs to let them know about it.

In this commit, we add an option for whether or not
this message is sent.

If more than 100 users are added at once, we
do not send notification bot DMs since it would
be a performance-costly operation.

We also send this threshold value of 100 in the
initial state data to the clients.

Fixes part of #31189
2025-06-26 10:08:11 -07:00
Aman Agrawal
68aefeafdd reminder: Use pretty message link for reminder text. 2025-06-25 12:05:28 -07:00
Tim Abbott
b437bcd5c4 topic_link: Document get_fallback_markdown_link. 2025-06-25 12:03:54 -07:00
Niloth P
fb74cd3ddf webhooks/opsgenie: Support linking to EU instances.
Adds a URL parameter to the webhook to track the region of the Opsgenie
instance (US/EU), and uses that to construct the alert URL in the
message.

Fixes #34947.
2025-06-25 11:52:02 -07:00
Anders Kaseorg
162a0980c0 requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-25 11:49:02 -07:00
Anders Kaseorg
750a08ad17 ruff: Fix LOG014 exc_info= outside exception handlers.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-25 11:49:02 -07:00
Anders Kaseorg
10705e0db3 validator: Disable WildValue equality comparison.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-25 11:49:02 -07:00
Anders Kaseorg
2747127e6c push_notifications: Convert UserPushIdentityCompat to dataclass.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-25 11:49:02 -07:00
Anders Kaseorg
f990a1400f ruff: Fix FURB122 Use of f.write in a for loop.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-25 11:49:02 -07:00
Anders Kaseorg
e8fdae8f7b ruff: Fix PLR1733 Unnecessary lookup of dictionary value by key.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-25 11:49:02 -07:00
Vector73
b612351e48 stream_setting: Add setting for who can move messages out of channel.
Adds `can_move_messages_out_of_channel_group` channel-level
permission for who can move messages out of the channel.

Fixes #34243.
2025-06-24 16:52:53 -07:00
Vector73
703601a5d5 stream_setting: Add setting for who can move messages within channel.
Adds `can_move_messages_within_channel_group` channel-level
permission for who can move messages within the channel.
2025-06-24 16:52:53 -07:00
Shubham Padia
83755c1aec markdown: Remove unused message_inline_ref.
Fixes #32640.
We cannot remove the styles yet since older dropbox previews will still
be using them. We can remove those in a followup issue.
2025-06-24 13:48:01 -07:00
Shubham Padia
bace83ec5a markdown: Change URL structure for dropbox preview to be up-to-date.
The URL structure for a shared link has changed since this function was
returned and this commit makes sure our code is in compliance with that
structure.

The concept of an album doesn't exist anymore and folders exist in-lieu
of that.

For dropbox links that are folders on non-image files, we show previews
same as any other link previews. It is not possible to get information
about the shared link except whether it is a file or folder. So for
title and description for that linked preview, we use `Dropbox file` or
`Dropbox folder` respectively.

Earlier, we were just having raw=1 as the query param to get the image
file if required, but now for every dropbox sharing link, preserving
query params is important (otherwise we get a 404), this commit makes
changes to address that.

For /sc/ links, it is not possible to generate them anymore (afaik), but
it is possible to view those existing links, so we support that link but
treat it as a folder instead.

You can check
https://www.dropboxforum.com/discussions/101001012/shared-link--scl-to-s/689070/replies/695266
for URL structure info.

We have used inline ignore for codespell since fo can be a valid
misspell of `of` and we don't want to ignore that.

https://chat.zulip.org/#narrow/channel/9-issues/topic/.F0.9F.93.82.20message_inline_ref.20dropbox.20links

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-06-24 13:48:01 -07:00
Shubham Padia
22b5744726 help: Remove unused message_handle_match.
A search for `relative|message` returns zero matches. We should remove
this unused part of `help_relative_links`.
2025-06-24 12:54:39 -07:00
Sahil Batra
8400c24665 groups: Make two fields of GroupPermissionSetting optional.
This commit makes require_system_group and allow_internet_group
fields of GroupPermissionSetting optional with default value of
False. "allow_internet_group" is False for all of the settings
and "require_system_group" is True for only two settings, so it
is better to not having to repeat them for every setting.
2025-06-23 09:49:11 -07:00
Evy Kassirer
4313648ca5 streams: Add subscriber_count to page load data. 2025-06-19 14:25:41 -07:00
Sahil Batra
b655bd14ea messages: Use "\x07" as topic for DMs and group DMs.
This commit updates code to use "\x07" as value for
"subject" field of Message objects for DMs and group
DMs, so that we have a unique value for DMs and group
DMs which cannot be used for channel messages.

This helps in avoiding having an empty string value as
topic for DMs, which is also used for "general chat"
channel messages, as large number of DMs in the realm
resulted in PostgreSQL query planner thinking that there
are too many "general chat" messages and thus generated
bad query plans for operations like fetching
"general chat" messages in a stream or moving messages
to and from "general chat" topic.

This change as done for ArchivedMessage and
ScheduledMessage objects as well.

Note that the clients still get "subject" value as
an empty string "".

This commit also adds tests for checking that "\x07"
cannot be used as topic for channel messages.

Fixes #34360.
2025-06-19 10:44:37 -07:00
Kislay Verma
2a120d2717 topic_link_util: Support message links in backend.
This commit adds support for message link
(#**stream>topic@message_id**) syntax in the
backend `topic_link_util` module.
2025-06-18 13:03:56 -07:00
Kislay Verma
43bf15f0fa topic_link_util: Add support for empty topics in the backend.
Fallback links with empty topics now have correct
url and text for the "general chat" topic.
2025-06-18 13:03:56 -07:00
Mohammad Reza Kianifar
0a7227cfbb report_message: Use existing template for reporting 1:1 DM via DM group.
To maintain API compatibility during and after the migration to use
DirectMessageGroup for 1:1 messages, we need to build the existing
report message format for 1:1 DMs using DirectMessageGroup.
2025-06-18 12:46:23 -07:00
Mohammad Reza Kianifar
f4b6af5d42 push_notification: Use existing payload for 1:1 DM using DM group.
To maintain API compatibility during migration to DirectMessageGroup
for 1:1 DMs, generate notification payloads for such messages in the
same format as those sent to a Personal recipient.

Fixes: part of issue #25713.
2025-06-18 12:44:56 -07:00
Vector73
6094bbe8a5 stream_settings: Add new topics_policy setting.
Added `topics_policy` channel setting to configure sending
messages in the empty topic.

Fixes #33549.
2025-06-17 17:05:58 -07:00
Vector73
92672c1339 settings: Add can_set_topics_policy_group realm setting.
Added `can_set_topics_policy_group` realm setting to control
permission to change per-channel `topics_policy`.
2025-06-17 17:05:58 -07:00
Vector73
62c67eae8e settings: Add a new topics_policy realm setting.
Added a new realm setting, `topics_policy` and deprecated
`mandatory_topics` setting as it now replaced by `topics_policy`.

Fixes part of #33549.
2025-06-17 17:05:58 -07:00
Tim Abbott
ddb0d3f555 help: Use final Flutter blog post URL.
We also update the "Zulip updates" URL, just to save a redirect.
2025-06-17 13:05:45 -07:00
Alya Abbott
18ec64f6ee updates: Add update message (level=17). 2025-06-16 10:53:52 -07:00
Aman Agrawal
4cca5652e3 slack_import: Pipe file processing error message to the user.
When the slack import fails due to invalid zip file being uploaded,
we take user back to the file upload page with an appropriate
error message.
2025-06-16 10:46:25 -07:00
Anders Kaseorg
4e31948f90 requirements: Upgrade django-cte from 1.3.3 to 2.0.0.dev.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-11 16:25:25 -07:00
Anders Kaseorg
b3f218bc41 user_groups: Convert realm_groups QuerySet to list.
It’s a list in the other branch.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-11 16:25:25 -07:00
Anders Kaseorg
f4f8f66961 user_groups: Fix get_members_and_subgroups_of_groups type.
zerver.lib.streams.get_anonymous_group_membership_dict_for_streams
calls it with a QuerySet[int].

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-11 16:25:25 -07:00
Shubham Padia
7eb9c9deef Groups: Can perform any join, leave, add, remove for deactivated group.
Fixes #33804.

We still do not allow permission settings to be set to deactivated
groups.
2025-06-11 14:58:14 -07:00
Sahil Batra
e243fc67fa populate_db: Use channel folder in dev database.
This commit creates "Engineering" channel folder and
adds "devel", "errors" and "test" channels to it.
2025-06-10 11:59:07 -07:00
Niloth P
6a1d231689 integrations: Use directory name to get HTTP headers from fixtures.
Previously, the integration's name was directly being used.
Due to this, the GitHub Sponsors integration which is in the same module
as the GitHub integration could not be used with the
`generate-integration-docs-screenshot` script, as it would be unable to
locate the fixtures.
2025-06-09 15:59:39 -07:00
Niloth P
f99772b131 integrations: Add missing parameter to Transifex's screenshot config. 2025-06-09 15:59:39 -07:00