Commit Graph

20050 Commits

Author SHA1 Message Date
Evy Kassirer
4313648ca5 streams: Add subscriber_count to page load data. 2025-06-19 14:25:41 -07:00
Lauryn Menard
0fde715a24 devlogin: Filter placeholder realms from a subdomain change.
Showing these realms in the drop down list of realms is not helpful
for developers, so we filter them out of the list. Realms that are
deactivated without a redirect are still listed.
2025-06-19 12:49:03 -07:00
Prakhar Pratyush
7970e1fa45 streams: Fix error while sending notice in deactivated stream.
Sending messages to a deactivated stream is not allowed with
the exception of notices sent in "channel events" topic.

Earlier, notice sent to a deactivated stream when it is
deactivated was working correctly but it was resulting in
an error in the following cases:
* Renaming stream
* Changing stream description
* Changing message retention period
* Changing posting permission
* Changing access permission

This commit makes sure to send notice successfully in those cases.
2025-06-19 12:47:54 -07:00
Tim Abbott
f5d0a3ee30 test_subs: Fix incorrect removed import.
Another use got added before the commit removing the import was merged.
2025-06-19 10:55:36 -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
Sahil Batra
5a45779634 test_message_dict: Add test for checking "subject" field value. 2025-06-19 10:44:37 -07:00
Sahil Batra
bdcdbc5565 tests: Add test to check edit history of a DM. 2025-06-19 10:44:37 -07:00
Sahil Batra
e06c181a95 tests: Move test to check permission to deactivate streams.
This commit moves test to check permission to deactivate
streams to test_channel_permissions.py.
2025-06-19 10:42:52 -07:00
Sahil Batra
3f8518f9d1 tests: Move channel administering permission tests.
This commit moves tests to check permission for administering
streams as per can_administer_channel_group setting to
test_channel_permissions.py.
2025-06-19 10:42:52 -07:00
Mateusz Mandera
0d17f34ff5 slack_import: Import Slackbot as a bot instead of a user.
Slackbot should be correctly marked as a bot rather than a regular user
- otherwise, it confusingly appears on the Users list and in the realm
creation from Slack import flow, in the dropdown for choosing the
organization owner account.

Closes #34649
2025-06-18 16:55:31 -07:00
Mateusz Mandera
75da563776 slack_import: Fix bug when need_select_realm_owner is not set.
When selecting the realm owner is not needed in the realm creation from
Slack flow, we don't set need_select_realm_owner value on the
preregistration_realm object. Thus, this codepath cannot expect to
always find the key - and instead should use .get(), defaulting to False.
2025-06-18 16:55:31 -07:00
Tim Abbott
f0331b8c50 api: Increment API feature level to 393. 2025-06-18 16:48:26 -07:00
Shubham Padia
00fe2236da message_delete: Sort message_ids when sending delete_message event.
Fixes #34324.
https://chat.zulip.org/#narrow/channel/412-api-documentation/topic/Make.20message_ids.20from.20message.20update.20event.20sorted
2025-06-18 16:48:21 -07:00
Shubham Padia
37bfb7c963 message_edit: Sort message_ids when sending update_message event.
https://chat.zulip.org/#narrow/channel/412-api-documentation/topic/Make.20message_ids.20from.20message.20update.20event.20sorted
2025-06-18 16:48:21 -07:00
Lauryn Menard
425abd83fc demo-orgs: Make password not required for demo org creation.
Creating a demo organization will not require the user to
set either an email or password, so explicitly set the
password field to not be required for that case.

Updates the form submitted in the dev environment to create
a new demo organization to not send a password value.
2025-06-18 16:47:09 -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
whilstsomebody
a1b3448c01 test_message_delete: Add test for do_delete_messages grouping logic.
This commit adds a test for the grouping logic of the
`do_delete_messages` function, which now groups public and private
messages based on their streams and topics.
2025-06-17 19:45:36 -07:00
Tim Abbott
a94280ee9b message_delete: Avoid fetching Stream objects in loops. 2025-06-17 19:45:36 -07:00
whilstsomebody
5b6ae6eb7a message_delete: Refactor do_delete_messages to group messages by topic.
This refactor updates `do_delete_messages` to categorize messages by
recipient and topic using a `defaultdict`. Messages are grouped into
batches where each batch corresponds to a unique recipient and topic
combination. For each group, a separate delete event is created and
processed, ensuring compliance with API requirements that mandate one
event per topic.

Co-authored-by: Mateusz Mandera <mateusz.mandera@zulip.com>
2025-06-17 19:45:36 -07:00
Tim Abbott
deaa43c7e6 api: Increment API feature level to 392. 2025-06-17 17:05:59 -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
whilstsomebody
053f30aace test_subs: Fix syntax errors in tests.
This commit fixes the use of `/json/...` by replacing
it with the correct `/api/v1/...`. Also removes
unnecessary `login_user` call when using `api_patch`.
2025-06-16 11:51:14 -07:00
Alya Abbott
18ec64f6ee updates: Add update message (level=17). 2025-06-16 10:53:52 -07:00
Aman Agrawal
fd0800eee6 slack_import: Order claimable users by alphabetically. 2025-06-16 10:46:25 -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
Aman Agrawal
853752292a registration: Indicate that slack import can take a while. 2025-06-16 10:46:25 -07:00
whilstsomebody
26e5b916bc test_subs: Fix the incorrect syntax in 'test_unarchive_stream'.
This commit fixes the use of `/json/streams/...` by replacing
it with the correct `/api/v1/streams/...`. Also removes
unnecessary `login_user` call when using `api_patch`.
2025-06-16 09:14:03 -07:00
PieterCK
a5a2adf23d integration-doc: Add instruction to Slack integration.
This adds an instruction on how to configure which Slack channels to
integrate with Zulip.
2025-06-12 09:35:54 -07:00
Anders Kaseorg
717cf60edf python: Use Django 5.2 reverse(…, query=…).
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-12 09:32:38 -07:00
Anders Kaseorg
d12601fbee migrations: Add through_fields for NamedUserGroup.direct_subgroups.
https://code.djangoproject.com/ticket/36061

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-06-11 16:25: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
Sahil Batra
79c2972232 tests: Move test to check permission to update message retention setting.
This commit moves test to check permission to update message retention
setting of a stream to test_channel_permissions.py.
2025-06-11 15:41:50 -07:00
Sahil Batra
0dee5f4c0d tests: Move subscription properties test to new file.
This commit moves subscription properties test to
test_subscription_settings.py.
2025-06-11 15:41:50 -07:00
Sahil Batra
62579b5b24 tests: Move tests to get streams and subscriptions to test_channel_fetch. 2025-06-11 15:41:50 -07:00
Sahil Batra
679a8363cb tests: Move test for updating default stream to test_default_channels.
This commit moves test for add or removing a stream as default using
"/json/streams/{stream_id}" endpoint to test_default_channels.py.
2025-06-11 15:41:50 -07:00
Sahil Batra
5228c2c97c tests: Create new test_default_channels.py file.
This commit moves tests for default streams and default
stream groups to a new file.

This commit also moves test_guest_user_access_to_streams
test to a different class in test_subs.py since it was
present in DefaultStreamTest class before.
2025-06-11 15:41:50 -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
Alex Vandiver
b9ab93068a email_mirror_server: Swallow and log all TLSSetupExceptions.
The only other flavor we have seen so far is ConnectionResetError, but
that is just as much a client error which we should log and move on,
and not log an exception for.
2025-06-09 10:29:33 -07:00
Lauryn Menard
c797c481b3 demo-orgs: Delete expired demo orgs in archive_messages cron job.
Adds delete_expired_demo_organizations to the archive_messages
management command, which is run as a cron job.

Adds "demo_expired" as a `RealmDeactivationReasonType` to be
used for this specific case of calling do_deactivate_realm.

The function loops through non-deactivated realms that have a
demo organization scheduled deletion datetime set that is less
than the current datetime.
2025-06-07 22:53:01 -07:00