Commit Graph

20476 Commits

Author SHA1 Message Date
Anders Kaseorg
e216317f88 test_mattermost_importer: Condition html2text crash on Python version.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2025-08-13 14:11:05 -07:00
Tim Abbott
3e84eaab5d onboarding: Improve welcome bot custom message wrapper.
The previous text was rather wordy, and using a silent mention makes
it clear who has the ability to control this group, and who one can
potentially contact with questions.
2025-08-13 14:09:20 -07:00
Alex Vandiver
04fe9be715 upload: Serve 0-byte files locally, not from S3. 2025-08-13 14:07:21 -07:00
Alex Vandiver
7480510aeb embeds: Propagate group membership before updating UserMessage flags. 2025-08-13 10:38:40 -07:00
Prakhar Pratyush
3cbf0e70a2 push_notification: Add support to send E2EE test push notification.
This commit adds an endpoint `/mobile_push/e2ee/test_notification`
to send an end-to-end encrypted test push notification to the user's
selected mobile device or all of their mobile devices.
2025-08-13 00:13:50 -07:00
Prakhar Pratyush
f034a6c3b4 push_notification: Remove is_removal param from send_push_notifications.
We can determine whether the request is meant to revoke an already
sent push notification using the "type" field of the payload.

Passing `is_removal` parameter explicitly to `send_push_notifications`
is not required.
2025-08-13 00:13:50 -07:00
Alya Abbott
a05c76fba3 updates: Edit update announcement (level=20).
Describe additional features; the prior version has not been
deployed to Cloud.
2025-08-12 17:25:42 -07:00
opmkumar
aa9aa2160b help: Clean up search by location documentation. 2025-08-12 15:26:12 -07:00
Vector73
f1d1d5f1a4 events: Add support for sending presence events in modern format.
If the client has passed `simplified_presence_events` as true
in the `client_capabilities` parameter of the `POST /register`
request, then the server will send `presence` events with the
`presences` field, which has the user presence data in the
modern API format. When that client capability is false, the
`presence` event will be unchanged and sent with the user
presence data in the legacy format.
2025-08-12 12:37:54 -07:00
Vector73
88761f70a2 event_schema: Rename "presence" event to "legacy_presence". 2025-08-12 12:14:56 -07:00
Mateusz Mandera
58427f8ed1 external_auth_id: Add new unique constraint. 2025-08-12 12:10:45 -07:00
Sahil Batra
5675860707 channel-folders: Send event when reordering channel folders. 2025-08-12 11:17:17 -07:00
Sahil Batra
bcdfcf909d welcome-bot: Only send message with custom text when testing.
We now only send the custom message when using
"Send me a test message" button and not send the
standard welcome bot message.
2025-08-12 00:12:52 -07:00
apoorvapendse
8f14b717ff zerver: Drop support for Zulip API emails in channel creation.
Also write the description a bit better.

Discussion:
https://chat.zulip.org/#narrow/channel/378-api-design/topic/Channel.20creation.20should.20return.20the.20channel.20ID/near/2240040.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-11 23:40:12 -07:00
Prakhar Pratyush
870591e2e5 test_urls: Skip api_docs/unmerged.d/ while testing api doc pages.
We missed to skip `api_docs/unmerged.d/` in 9ec15e99bd,
resulting in test failure in pull requests where it is present.
2025-08-11 14:37:31 -07:00
Mateusz Mandera
f119c33789 delete_in_topic: Don't fetch .recipient for each message in a loop.
The grouping logic in `do_delete_messages` calls
`message.is_stream_message()` in a loop, which needs to access
message.recipient. This is obviously super inefficient if .recipient
hasn't been prefetched for the message objects.

`delete_in_topic` is the only function that calls `do_delete_messages`
with many messages, so this is the only spot we need to fix, to address
the immediate bug.
Of course a better improvement would be to fix `do_delete_messages` to
do something smarter than naively accessing message.recipient in a loop.
2025-08-11 10:08:40 -07:00
apoorvapendse
6203861529 zerver: API to create channel.
Fixes #16206.

Co-authored-by: Sahil Batra <sahil@zulip.com>
Co-authored-by: Steve Howell <showell@zulip.com>
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-08 19:29:17 -07:00
Tim Abbott
6ef2591b47 test_invite: Fix a test failing with old databases. 2025-08-08 18:59:37 -07:00
Saubhagya Patel
bb5c87e306 bots: Add a setting to customize the Welcome Bot message.
This commit includes the following changes:
- Add an administrator setting to customize the Welcome Bot
message when sending an invitation.
- Add an API endpoint to test the customized Welcome Bot message
by sending a copy of the message to the administrator.

Fixes #27663.

Co-authored-by: Akarsh Jain <akarsh.jain.790@gmail.com>
2025-08-08 18:59:37 -07:00
apoorvapendse
4d49fa6fbb streams: Extract zephyr realm invite check.
This will be reused later in the
`/channels/create` view.

Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-08 18:41:47 -07:00
apoorvapendse
1190afbe4f streams: Extract pydantic validation for topics_policy.
Signed-off-by: apoorvapendse <apoorvavpendse@gmail.com>
2025-08-08 18:41:47 -07:00
Mateusz Mandera
254b0ff477 scim: Add support for Groups. 2025-08-08 17:29:11 -07:00
Sahil Batra
f7e9f37edc settings: Fix re-ordering folders when there is an archived folder.
This commit updates webapp code to include archived folder IDs as
well in the "order" list passed when re-ordering folders.

Also, updated API documentation to mention that archived folder IDs
should also be included.
2025-08-08 16:29:00 -07:00
Shubham Padia
5f9860776f test_docs: Remove help specific tests and port rest over to /api.
We do not test relative links here since relative links were only
used in the old help pages. We should probably remove the logic
for relative links after we have done the official cutover to the
starlight help center: #35654.
2025-08-08 11:59:29 -07:00
Shubham Padia
075809b93e test_middleware: Remove help related tests.
Help center is going to cutover to using starlight. We won't have that
help center running during our backend tests for now, that will be done
after cutover. Remove help related opengraph tests. We have replaced
instances from api_docs wherever possible, but for most of the cases, an
equivalent was not found in api_docs.

There is no api_docs file that starts with `{settings_tab` or an
admonition or `{start_tabs}` and thus we need to remove those tests.

test_settings_tab was not testing what it said it was testing,
deactivate-your-account.md did not start with `{settings_tab` anymore.
That was changed in 584124bb45.
2025-08-08 11:59:29 -07:00
Shubham Padia
9ec15e99bd test_urls: Use /api instead of /help pages for some tests.
We are going to move the help center to starlight soon and the tests
won't be able to access that help center until we solve things in a
followup issue. We move some of the urls being tested from /help to /api
to not loose coverage on those tests.
2025-08-08 11:59:29 -07:00
Shubham Padia
3e60b16ac1 starlight_help: Move help-beta over to starlight_help.
We are starting the cutover process and starlight_help is the directory
we have agreed on to place our new help center project. We do not want
to use `starlight_help` as the URL for the project, but this commit
changes the url from `help-beta` to `starlight_help` temporarily since
we can only change URL once we get rid of the current help center
project. That will be done in a future commit.
2025-08-08 11:59:29 -07:00
Alya Abbott
e712f02c91 help: Document channel folder management functionality.
Updates the left sidebar and relative settings link in both the
current and new help center documentation.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-08-08 07:19:57 -07:00
Tim Abbott
f287a82743 webhooks: Add nocoverage comment for unused MAPPING.
This code path isn't used yet; I expect we'll get to remove this when
we start using it for a specific integration in the near-ish future.
2025-08-07 17:39:05 -07:00
Niloth P
7022811349 integrations: Add URL option and UI for mapping messages to Zulip channels.
This commit adds a "mapping" URL option preset that adds "Matching Zulip
channel" option to the stream dropdown widget. When that option is
chosen from the dropdown, it adds another parameter to the integration
URL -- "&mapping=channels".

This "mapping" parameter is meant to be used by integrations like Slack
to identify whether the user wants to map Slack channels to different
Zulip channels or different topics within a single channel.

This adds an icon for the `mapping`s' drop down option in the "Where to
send notification" drop down field.

Co-authored-by: Pieter CK <pieterceka123@gmail.com>
Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-08-07 17:19:03 -07:00
PieterCK
3863f4d6a5 integrations: Add IGNORE_PRIVATE_REPOSITORIES preset WebhookUrlOption.
This refactors the `ignore_private_repositories` URL option to be a
preset because it can be used by other "version-control" integrations.
2025-08-07 17:19:03 -07:00
PieterCK
57ff908af9 webhook_common: Add a method to build preset WebhookUrlOption.
This adds `WebhookUrlOption.build_preset_config` method which builds
pre-configured WebhookUrlOptions objects. It can be used to abstract
commonly used WebhookUrlOption settings or to construct special
settings that have additional logic and UI in the web-app modal for
generating an incoming webhook URL.

Currently, one such setting is the "branches" url option. This setting
is meant to be used by "versioncontrol" integrations such as GitHub,
Gitea, etc. It adds UI that lets the user to choose which branches of
their repository can trigger notifications. So, we refactor those
integrations to use `build_preset_config` for the "branches" option.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2025-08-07 17:19:03 -07:00
Kislay Verma
f0a88d51cc message_reminders: Add support for notes.
This commit adds the ability for users to include notes
with their message reminders.

Fixes #35070.

Co-Authored-By: Aman Agrawal <amanagr@zulip.com>
2025-08-07 17:13:12 -07:00
Tim Abbott
f177598ecf api: Increment API feature level to 414. 2025-08-06 16:34:40 -07:00
Shubham Padia
c4cb75979a channel-folders: Order by order field in GET method. 2025-08-06 16:34:40 -07:00
Shubham Padia
22b231ab6f channel-folders: Add PATCH method to reorder channel folders.
The test cases are copied from ReorderCustomProfileFieldTest since we
are imitating the reordering mechanism from custom profile fields to
channel folders.
2025-08-06 16:34:40 -07:00
Shubham Padia
40132e200b channel-folders: Add order field and backfill it alphabetically. 2025-08-06 16:34:40 -07:00
Shubham Padia
d609bd44a9 channel-folders: Setup data in class instead of each test.
We used the data setup from the get test case since it needed the most
number of folders.
2025-08-06 16:34:40 -07:00
Alex Vandiver
d6f1526086 transfer: Upload thumbnails for image files.
Fixes: #35029.
2025-08-06 15:46:07 -07:00
Alex Vandiver
ad915679ad tests: Add tests for transferred file metadata. 2025-08-06 15:46:07 -07:00
Alex Vandiver
a590cfdbe8 tests: Add tests for S3 image metadata, and lack therof on thumbnails. 2025-08-06 15:46:07 -07:00
Alex Vandiver
2909d4917c send_zulip_update_announcements: Log updates in the post-deploy hook. 2025-08-06 09:52:45 -07:00
Alex Vandiver
b98d3fc7c4 tests: Clarify why encoding test uses NamedTemporaryFile. 2025-08-06 09:41:44 -07:00
Alex Vandiver
3325c21e7f tests: Add clarifying comment about "wrong" charset. 2025-08-06 09:41:44 -07:00
Alex Vandiver
218bbe041e upload: Adjust minimum encoding confidence thresholds.
UTF-8 is far and wide the dominant encoding, so we assume that
encoding if we have more than 66% confidence -- this allows it to be
guessed even for short files.  ISO-8859-1 caps at 73% confidence, so
we assume that if it's the best option and it hits that max.
Otherwise, we still require 90% confidence.
2025-08-06 09:41:44 -07:00
Prakhar Pratyush
787d73f018 push_notification: Update the payload data that gets encrypted.
This commit updates the data that gets encrypted to be
the same on both android and iOS.

The data and its format is almost the same as what we send
as FCM payload to android clients with no E2EE support,
changes are:

For send push notification payload:
* 'realm_id`, 'server', 'sender_email', and 'realm_uri' fields
  don't exist in the new payload.
* 'event' field renamed to 'type'
* 'stream' and 'stream_id' fields renamed to 'channel_name'
  and 'channel_id' respectively.
* The value of 'recipient_type' will be 'channel' & 'direct'
  instead of 'stream' & 'private' respectively.
* 'zulip_message_id' field renamed to 'message_id'

For remove push notification payload:
* 'realm_id`, 'server', and 'realm_uri' fields don't exist
  in the new payload.
* 'event' field renamed to 'type'
* 'zulip_message_ids' field renamed to 'message_ids' and it's
  value will be a JSON array instead of a string.

In the existing iOS client, we have no code of our own involved
in constructing the notifications in the UI, and instead we
leave it to the iOS SDK to do so.

Since, for clients with E2EE support the data is going to be
interpreted by our own code, not by the iOS SDK - we are free
to keep the same data and format.

Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-08-05 16:54:22 -07:00
Prakhar Pratyush
dd134ef325 push_notification: Remove 'content_truncated' field from FCM payload.
This commit removes the 'content_truncated' field from the FCM
payload to send push notification as it was unused by clients.
2025-08-05 16:54:22 -07:00
Prakhar Pratyush
c9edb9c9ce push_notification: Remove 'zulip_message_id' from FCM payload.
This commit removes the 'zulip_message_id' field from the FCM
payload for remove push notification.

Clients that use `zulip_message_ids` instead have been out for
years and we no longer support older client versions that don't.
2025-08-05 16:54:22 -07:00
Prakhar Pratyush
1a5cab130d push_notification: Remove obsolete fields from APNs payload.
Mobile push notification payloads for APNs no longer contain
the `server` and `realm_id` fields, which were unused.
2025-08-05 16:54:22 -07:00
Vector73
f689dfc3c3 message_move: Mark notification messages as read for acting user.
When moving messages, the notification messages should be
automatically marked as read for the user who moved the messages.
2025-08-05 15:27:08 -07:00