Commit Graph

356 Commits

Author SHA1 Message Date
Anders Kaseorg
b742ab18f9 emoji: Remove setting for deprecated Google blobs emoji set.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-10-01 13:35:06 -07:00
Aman Agrawal
40f4ad2cb0 register: Add AI/LLM as option for how user found Zulip. 2025-09-24 10:24:23 -07:00
Sahil Batra
764f4aa2e0 groups: Use realm_for_sharding for limiting NamedUserGroup queries.
For get and filter queries of NamedUserGroup, realm_for_sharding
field is used instead of realm field, as directly using
realm_for_sharding field on NamedUserGroup makes the query faster
than using realm present on the base UserGroup table.
2025-09-23 12:15:53 -07:00
Sahil Batra
1e21f7b224 register: Rename stream_creator_or_nobody to channel_creator.
This commit renames `stream_creator_or_nobody` value for
`default_group_name` field in `server_supported_permission_settings`
object to `channel_creator`.
2025-09-23 12:12:23 -07:00
Anders Kaseorg
1fdb81b6f8 streams: Remove is_in_zephyr_realm field from database.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-16 11:23:11 -07:00
Anders Kaseorg
40a022dcc3 zephyr: Remove Zephyr mirroring support.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-09-16 11:18:18 -07:00
Alex Vandiver
839135d007 users: Allow 1-character names.
Real people have 1-character names.  As seen by the previous attempt
to enforce length, in b7779667fc, real
people have names with all sorts of lengths.  All that we should care
about is that they're non-empty.
2025-09-08 14:30:59 -07:00
Mateusz Mandera
51cef01c29 message: Use .is_channel_message column instead of is_stream_message().
This avoids a potential unnecessary message.recipient fetch required by
is_stream_message(). is_stream_message() methods precedes the addition
of the denormalized is_channel_message column and is now unnecessary.

In practice, we usually fetch Message objects with `.recipient` already,
so I don't expect any notable performance impact here - but it's still a
useful change to make.
2025-08-19 23:37:07 -07:00
Mateusz Mandera
4e3ec77a0f retention: Eliminate join with Recipient table when archiving DMs.
We can use the is_channel_message column instead of doing the join to
filter on recipient type.
2025-08-19 23:36:10 -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
Mateusz Mandera
58427f8ed1 external_auth_id: Add new unique constraint. 2025-08-12 12:10:45 -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
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
Shubham Padia
40132e200b channel-folders: Add order field and backfill it alphabetically. 2025-08-06 16:34:40 -07:00
Mateusz Mandera
40b1f6eb4e confirmation: Replace RealmCreationKey - use Confirmation instead.
Fixes #20028.

There's no reason to have a special `RealmCreationKey` class - the
`Confirmation` system already does this job.

This is somewhat complicated by the need to write a migration for
`RealmCreationKey`->`Confirmation` for pre-existing, valid objects, to
avoid breaking realm creation links that haven't been used yet.
2025-08-04 18:41:15 -07:00
Sahil Batra
072516c2bb channel-folders: Update unique name constraint.
This commit updates code to require unique names for only
non-archived folders in a realm, which means a folder can
use a name which is being used by an archived folder.
2025-08-04 13:22:11 -07:00
Lauryn Menard
7a9b78f1f5 settings: Add user setting to ignore channel folders in left sidebar.
Fixes #35573.
2025-08-01 09:18:19 -07:00
Sahil Batra
6186df4f72 channel_folders: Update MAX_NAME_LENGTH to 60. 2025-07-28 23:12:58 -07:00
Prakhar Pratyush
fc6cd9a966 settings: Add require_e2ee_push_notifications realm setting.
This commit adds a realm setting:
"Require end-to-end encryption for push notification content".

This commit just involves backend & UI changes to add the setting,
the impact of this setting is in the next commit.

Fixes part of #35370.
2025-07-28 17:06:59 -07:00
Alex Vandiver
83acf70d0f models: Add a partial index on unread DMs.
This helps the find_first_unread_anchor call for DMs with a user.
2025-07-22 20:57:36 -07:00
Prakhar Pratyush
7e1afa0e8a push_notification: Send end-to-end encrypted push notifications.
This commit adds support to send encrypted push notifications
to devices registered to receive encrypted notifications.

URL: `POST /api/v1/remotes/push/e2ee/notify`
payload: `realm_uuid` and `device_id_to_encrypted_data`

The POST request needs to be authenticated with the server’s
API key.

Note: For Zulip Cloud, a background fact about the push bouncer is
that it runs on the same server and database as the main application;
it’s not a separate service. So, as an optimization we directly call
'send_e2ee_push_notifications' function and skip the HTTP request.
2025-07-22 17:08:55 -07:00
Alex Vandiver
2f4dd72076 push_notifications: Adjust APNs tokens to be case-insensitive in the database.
APNs apparently treats its tokens case-insensitively; FCM does not.
Adjust the `unique_together` to instead be separate partial
constraints, keyed on the `kind` of the PushDeviceToken.
2025-07-22 14:30:13 -07:00
Vector73
a02614204a settings: Add can_set_delete_message_policy_group setting.
Adds new organization setting `can_set_delete_message_policy_group`
for defining who can set per-channel message delete permissions.

Fixes #34214.
2025-07-17 15:44:53 -07:00
Vector73
97a43fa6b6 stream_settings: Add can_delete_own_message_group setting.
Adds per-channel `can_delete_own_message_group` setting for
defining who can delete their own message in the channel.
2025-07-17 15:44:52 -07:00
Vector73
c4e641365b stream_settings: Add can_delete_any_message_group setting.
Adds per-channel can_delete_any_message_group setting for
defining who can delete any message in the channel.
2025-07-17 15:44:42 -07:00
Mateusz Mandera
374c1a93ee realm_audit_logs: Add clarifying comment to REALM_IMPORTED event. 2025-07-14 15:11:43 -07:00
Prakhar Pratyush
5f8edf669d zerver: Add endpoint to register a push device to server.
This commit adds an endpoint to register a push device
to receive E2EE push notifications.
2025-07-14 14:52:39 -07:00
Prakhar Pratyush
afe6986991 register-queue: Add push_devices in response.
This commit adds a `push_devices` dictionary to
`POST /register` response, keyed with push account ID,
where each entry describes the user's push device's
registration status and error code (if registration failed).
2025-07-14 14:52:38 -07:00
Prakhar Pratyush
6a4b06b6f4 zerver: Add PushDevice model.
This commit adds a `PushDevice` model where each row
corresponds to an account on an install of the app
that has attempted to register with the bouncer to
receive mobile push notifications.

This is the core server table storing registrations
that are potentially registered with the mobile push
notifications bouncer service.
2025-07-14 14:52:38 -07:00
Anders Kaseorg
ea48a283b1 mypy: Add google-re2-stubs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-07-14 14:33:54 -04:00
Mateusz Mandera
a61d849e37 ldap: Implement external auth id auth+sync.
Fixes #24104.
2025-07-09 15:31:17 -07:00
Vector73
a77fc6aa79 stream_settings: Add new disable_topics option to topics_policy.
Adds new configuration option `disable_topics` in `topics_policy`
channel setting to support disabling topics in the channel.

Fixes #34553.
2025-07-09 14:25:53 -07:00
opmkumar
8786b12f0c streams: Add can_resolve_topics_group setting.
Fixes #19955.
2025-07-08 16:53:43 -07:00
Aditya Kumar Kasaudhan
cc9d78328e users: Add SECURITY_SENSITIVE_USER_SETTINGS to UserBaseSettings.
This commit is a preparatory step for allowing organization owners to
reset user preferences, defines a set of sensitive user settings
that will be protected from resets by organization owners.
2025-07-07 09:48:25 -07:00
Rohan Gudimetla
a3e7ef8e71 left_sidebar: Add navigation option to go to top unread topic.
This commit adds option in personal settings to allow
navigation of channel links in left sidebar to the top
unread topic in that channel.

In cases of no unread messages in unmuted topics of the channel,
it falls back to the top topic of channel.

Fixes #35066
2025-07-03 18:14:10 -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
opmkumar
87d14086af settings: Add web_left_sidebar_unreads_count_summary setting.
Co-authored-by: Akarsh Jain <akarsh.jain.790@gmail.com>

Fixes part of #28759.
2025-06-27 13:50:15 -07:00
Anders Kaseorg
47aa34097b lookups: Adjust for django-stubs change.
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
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
Tim Abbott
8179a31dc7 docs: Delete legacy presence subsystem page.
Everything on this page is now better explained in the API
documentation for presence.
2025-06-19 15:20:15 -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
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
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
Tim Abbott
446ba1b538 settings_data: Optimize user_can_access_all_other_users.
This fixes an important issue where this function being called in a
loop can consume as much as 1ms per iteration for users who are in a
lot of groups.
2025-06-06 10:53:03 -07:00
Mateusz Mandera
0c62a2ed4f models: Fix typo in RealmAuthenticationMethod docstring. 2025-06-05 16:08:21 -07:00