Commit Graph

1516 Commits

Author SHA1 Message Date
ImDooMLorD
b6f09b6dab errors: Use shared class for message when email is already in use.
Replaces "Email '{email}' already in use" with "Email is already in use."
2025-03-04 16:10:25 -08:00
Tim Abbott
1044af0015 api: Clarify semantics of sender_id for message edit typing. 2025-02-28 13:23:52 -08:00
opmkumar
c97fd1bca5 api: Rename edit typing endpoint to /messages/{message_id}/typing.
This is more consistent with how other URLs work in Zulip.

Replaces `/message_edit_typing` with `/messages/{message_id}/typing`.
The `message_id` parameter, previously passed in the request body,
is now included in the URL path.
2025-02-28 13:20:46 -08:00
Saubhagya Patel
d0c5c1cacb settings: Add backend to change allow_edit_history to integer field.
This commit implements the backend of migrating the
`allow_edit_history` setting to
`message_edit_history_visibility_policy`.
This allows organizations, to have an intermediate setting to
view only the "Moves" history of the messages.

We still pass `realm_allow_edit_history` in `/register` response
though for older clients with its value being set depending on the
value of `realm_message_edit_history_visibility_policy`. We set
`realm_allow_edit_history` to `False` if the
`realm_message_edit_history_visibility_policy` is "None", and
`True` for "Moves only" or "All" message edit history.

Fixes part of #21398.

Co-authored-by: Shlok Patel <shlokcpatel2001@gmail.com>
Co-authored-by: Tim Abbott <tabbott@zulip.com>
2025-02-25 18:18:23 -08:00
Shubham Padia
a80b2e478c get_streams: Return metadata access streams in include_all.
This parameter is no longer restricted to realm administrators. Any
user can get the streams they have metadata access to by setting this
parameter to true.
2025-02-25 14:25:43 -08:00
Sahil Batra
bafec11c61 streams: Add new can_subscribe_group permission setting.
Fixes part of #33417.
2025-02-25 13:17:15 -08:00
Shubham Padia
ce031c4b52 get_stream: Rename include_all_active to include_all.
We keep around the old `include_all_active` parameter for backwards
compatibility.
Web frontend doesn't use this API and thus there were no changes needed
there.
2025-02-24 22:17:15 -08:00
Shubham Padia
6dde44cf37 get_streams: Add include_can_access_content.
Also add some query count checks.
See https://chat.zulip.org/#narrow/channel/378-api-design/topic/GET.20.2Fstreams.20with.20new.20permissions/with/2096944
for API design discussion.
2025-02-24 22:15:18 -08:00
sanchi-t
b2bc8db6bc message_flags: Add skipped unsubscribed stream ids in the response.
Added `ignored_because_not_subscribed` field in the response of
`/messages/flags/narrow` endpoint.

Fixes a part of #23470.

Co-authored-by: Hemant Umre <hemantumre12@gmail.com>.
2025-02-23 13:59:46 -08:00
Anders Kaseorg
4e04eed745 typos: Fix typos caught by typos and mwic.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-18 19:44:02 -08:00
Lauryn Menard
8561800676 video-calls: Add Zoom Serverto Server OAuth integration.
Adds a second Zoom integration that uses the Zoom Server to Server
OAuth app process. Only one of the two Zoom integrations can be
configured on a Zulip server.

Adds a cache for the access token from the Zoom server so that it
can be used by the server to create meetings for the approximate
duration of the access token

In the web-app compose box, if the user's delivery email does not
match a user on the configured Zoom account for the server to server
integration, then a compose box error banner will be shown when the
error response is received after clicking/selecting the video or
audio call button.

Also updates the production documentation for the both types of Zoom
integration apps (Server to Server and General). The General app
process for Zoom now requires unlisted apps to go through their
review process, which we now have documented.

Fixes #33117.
2025-02-13 16:35:43 -08:00
Lauryn Menard
9fa57fd24a api-docs: Update feature level 329 changelog entry and related notes.
Clarifies that the alert is shown if the current time displayed by
the time zone configured on the user's device differs from the
time displayed for the users's profile time zone.

Removes incorrectly having web_suggest_update_timezone as a separate
field returned by the POST /register response. It will only be a
field in the user_settings and realm_user_settings_defaults objects.
2025-02-13 12:41:21 -08:00
Lauryn Menard
d32f9862a5 api-docs: Clarify documentation for "timezone" user setting.
Refers to the setting as the "profile time zone" to help clarify
that this user setting is used for displaying the user's local
time to other users.

Adds links to the help center article about this user setting.

More consistently notes the format of the string that's being
returned is an IANA identifer of the time zone.
2025-02-13 12:41:21 -08:00
Alex Vandiver
a7d513e5ec users: Remove unnecessary get_api_key helper.
Using the column name is clearer.
2025-02-13 12:40:53 -08:00
Vector73
2ef9695ef0 settings: Migrate wildcard_mention_policy to group-based permission.
Added new group-based permission setting
`can_mention_many_users_group` to replace `wildcard_mention_policy`.
2025-02-12 23:21:33 -08:00
opmkumar
2a15da47d9 message_edit: Show typing indicator for message editing.
This commit adds typing indicators for message editing in stream
as well as in dm, if the send typing notification
for corresponding is enabled.

Based on earlier work in #28585.

Co-authored-by: Rohan Gudimetla <rohan.gudimetla07@gmail.com>

Fixes #25719.
2025-02-12 15:08:56 -08:00
Sahil Batra
7eeb8a2c26 settings: Add personal setting to show or hide AI features.
Fixes #33231.
2025-02-12 12:05:04 -08:00
Sahil Batra
4ca28bb850 settings: Add setting to control permission for topic summarization. 2025-02-12 12:05:04 -08:00
Sahil Batra
9b38444e42 register: Add server_can_summarize_topics to response.
We now pass a new field in register response to tell
clients whether summarizing topics is enabled for the
server or not.
2025-02-12 12:05:04 -08:00
Prakhar Pratyush
0e284464f1 api_docs: Improve docs related to mandatory topics. 2025-02-12 09:37:21 -08:00
Shubham Padia
6e588b5b4a openapi: Make stream setting groups documentation up-to-date. 2025-02-11 15:09:16 -08:00
Shubham Padia
aabf42c2ce stream: Show private channel for their channel admins.
Fixes https://chat.zulip.org/#narrow/channel/101-design/topic/permissions.20for.20admin.20to.20unsubscribe.20others/near/2060197
Non realm admin users were not able to view private channels they were
an administrator of but not subscribed to it. This commit changes that.
We also made changes for those users to be able to see the subscribers
list.

The increase in query count in test_home and test_event_system can be
mitigated by only fetching recursive user group ids when needed within
the `validate_user_access_to_subscribers_helper` function. But that
would require refactoring that function to handle multiple streams and
subscriptions at once, along with changing how that function is used at
different places, which might be an exercise better left as a follow up.
We have optimised the code a little bit by not fetching the group ids in
case the current user is a realm admin.

We are fetching channel_admin_ids and users belonging to
can_add_subscribers_group directly in stream_subscription.py without
using the helper function
`get_user_ids_with_metadata_access_via_permission_groups`. This is due
to a cyclic dependency and we will move `bulk_get_subscriber_peer_info`
to another file in the next commit.
2025-02-11 15:09:16 -08:00
Shubham Padia
ca1aba9fc3 stream: Allow realm & channel admins to change private channel setting.
Previously, realm and channel admins were not able to change settings
for a private channel they were not subscribed to. This commit changes
that.

We have only added the exception for can_add_subscribers_group
and not privacy settings.

We also need proper functions with proper terminologies for content
and metadata access.
2025-02-11 15:09:16 -08:00
Shubham Padia
4d02a082a0 stream: Users with permission to administer can unsubscribe others.
We've also converted the function to check for permission to unsubscribe
others to accept a list of streams instead of checking each stream one
by one.
2025-02-11 15:09:16 -08:00
Shubham Padia
0f51b029a0 stream: User with just can add permissions should be able to add. 2025-02-11 15:09:16 -08:00
Vector73
cb6f0fd63c realm: Add setting to notify user on DMing guest.
Added `enable_guest_user_dm_warning` setting to decide whether
clients should show a warning when a user is composing to a guest
user in the organization.

Fixes #30078.

Co-authored-by: adnan-td <generaladnan139@gmail.com>
2025-02-06 12:15:41 -08:00
Prakhar Pratyush
46f518fdbf api_docs: Improve topic parameter docs to list restricted values.
This commit updates the docs to specify that when topics are
required in an organization, the `topic` parameter in
`POST /messages` and `PATCH /messages/{message_id}` cannot be
* "(no topic)"
* an empty string
* `realm_empty_topic_display_name`.
2025-02-05 12:04:39 -08:00
Prakhar Pratyush
d4ae480985 api_docs: Update scheduled_message docs to specify empty string topic.
We missed to update this section of the docs while working
on feature level 334.
2025-02-05 12:04:39 -08:00
Vector73
a2c3138418 settings: Remove bot_creation_policy setting.
Removed `bot_creation_policy` property, as the permission to create
bot users in the organization is now controlled by two new realm settings,
`can_create_bots_group` and `can_create_write_only_bots_group`
2025-01-30 11:37:35 -08:00
Vector73
d48164ce1e settings: Add two new realm settings to restrict bot creation.
Added `can_create_bots_group` setting which controls who can
create any type of bots in the organization.

Added `can_create_write_only_bots_group` setting which controls
who can create incoming webhooks in the organization in additon
to those who are in `can_create_bots_group`.
2025-01-30 11:37:33 -08:00
Shubham Padia
204fa1e9f2 stream: Make documentation for group permission settings simpler. 2025-01-27 11:26:06 -08:00
Anders Kaseorg
0ba41328fd openapi: Fix misuse of nullable as sibling of oneOf.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-24 23:00:21 -08:00
bedo
21199beb73 stream_delete_event: Include only stream IDs in the event.
Fixes #32369

Migrate stream delete event to include only stream ids in the form of
"stream_ids": [1,...], because clients only need the ids.

While keep sending ids in the form of "streams": [{stream_id: 1},...]
for compatibility with all clients other than web.
2025-01-24 17:58:32 -08:00
Prakhar Pratyush
181572021d get_stream_topics: Add support for empty topic name.
This commit is a part of the work to support empty
string as a topic name.

Previously, empty string was not a valid topic name.

Adds `allow_empty_topic_name` boolean parameter to
`GET /users/me/{stream_id}/topics` endpoint to decide
whether the topic names in the fetched `topics` array
can be empty strings.

If False, the topic names in the fetched response will
have the value of `realm_empty_topic_display_name` field
in `POST /register` response replacing "".

Fixes part of #23291.
2025-01-22 15:54:11 -08:00
Shubham Padia
a76042ce39 invite: Any combination of default streams should be subscribe-able.
Fixes #32706.

A user with permission to invite users should be able to subscribe users
to any of the default streams whether they have the permission to do so
or not for each of those default streams or not. This should only happen
in the invite code path, and not the subscribe code path.

This commit also adds the ability to pick and chose default streams if
you do not have the permission to subscribe to any other channels.

Before this, if you did not have the permission to subscribe any other
channels, only the checkbox to subscribe to all the default streams at
once was available to you.

For the stream pill typeahead, we don't show streams that the user
cannot subscribe other users to. For more details, see

   https://chat.zulip.org/#narrow/channel/101-design/topic/can.20subscribe.20other.20users.20permission.20invite
2025-01-22 14:27:06 -08:00
Shubham Padia
97996b9929 streams: Add can_add_subscribers_group as a setting.
We're not using this setting to check the permissions yet.
2025-01-22 14:27:06 -08:00
Tim Abbott
b1a5755864 openapi: Fix broken links to group-setting-values. 2025-01-22 14:27:06 -08:00
Shubham Padia
275a1a4c69 realm: Use can_add_subscribers_group instead of invite_to_stream_policy.
We remove `invite_to_stream_policy` from the backend wherever applicable
except deleting the field. We have just ported the existing behaviour of
`invite_to_stream_policy` to `can_add_subscribers_group` except one
change. We have added an explicit exception for admins to have this
permission whether they are part of this group or not. The reason for
this is we are adding `stream.can_add_susbcribers_group` in the future
which will grant all admins permission to subscribe other users to a
channel given they have access to a channel. So it makes sense that we
add this exception to the realm level property also.
See https://chat.zulip.org/#narrow/channel/101-design/topic/Can.20subscribe.20other.20users.20on.20user.20profile/near/2039825
2025-01-22 12:33:58 -08:00
Shubham Padia
3cdc9d8459 realm: Add can_add_subscribers_group as a setting.
This commit just adds the setting, the work to use this setting and
replace `invite_to_stream_policy` will be done in future commits.
2025-01-22 12:33:56 -08:00
Sahil Batra
264e49e7e8 groups: Allow changing description and settings for deactivated groups.
We now allow changing description and all the permission settings
for deactivated groups as well, as there is no need to restrict
it and makes handling UI for deactivated groups easier.
2025-01-16 14:38:45 -08:00
Sahil Batra
abbd546531 openapi: Fix description for update-user-group endpoint.
Description for "PATCH /user_groups/{user_group_id}" endpoint
only mentioned updating name and description, but permission
settings are also updated using the same endpoint.
2025-01-16 14:25:43 -08:00
Prakhar Pratyush
fb91cd6f4d message_edit: Disallow resolving empty string topic.
This commit makes changes to the edit message endpoint
to disallow resolving empty string topic.

It also removes the resolve topic button in the web client
from topic popover and message header for empty string topic.
2025-01-14 14:22:21 -08:00
Anders Kaseorg
f223251ffe requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-14 09:42:16 -08:00
Tim Abbott
35e3c197c5 openapi: Fix styling of reactions deprecation notice. 2025-01-13 13:17:59 -08:00
Tim Abbott
2a10907827 openapi: Fix a whitespace typo causing prettier failures. 2025-01-13 13:03:44 -08:00
Vector73
e487a5c8c7 reaction: Add user object back in reaction events.
The deprecated `user` object was removed from message objects
and reaction events in #32701. This commit restores the `user` object
in reaction events to maintain compatibility with mobile clients.
2025-01-13 12:57:55 -08:00
Maneesh Shukla
4362c8d3c9 password: Add password_max_length to register response.
This allows clients to render UI that disallows invalid passwords
before sending them to the server.
2025-01-13 11:47:34 -08:00
Nehal Sharma
04f06a4588 integrations: Add support for BigBlueButton voice only calls.
We now allow users to create voice calls when their call provider is
BigBlueButton. This is done by creating a call where cameras are
disabled for all participants in the call -- a voice call, and making
only the call creator the moderator, so no one else can switch a voice
only call to a video call.

Also, we stop using the deprecated fields "attendeePW" and "moderatorPW"
in the Big Blue Button API, and use "role" instead.

The side effects are that now we only support BigBlueButton 2.4 and
above, and that only the call creator is a moderator and all other
joinees are viewers for all BigBlueButton calls.

Fixes: #26550.

Most of the code for the integration was written by Nehal.
Apoorva made the changes that resolve conflicts which were
introduced because of the `typed_endpoint` decorator.

With some documentation tweaks by tabbott.

Co-authored-by: Apoorva Pendse <apoorvavpendse@gmail.com>
2025-01-09 13:54:46 -08:00
Prakhar Pratyush
dc35e79701 streams: Allow specifying sender during channel email generation.
This commit adds a `sender_id` parameter to the
`GET /streams/{stream_id}/email_address` endpoint to specify the
ID of a user or bot which should appear as the sender when messages
are sent to a channel using the channel email address.

Earlier, Email gateway bot was always the sender.

Fixes part of #31566.
2025-01-08 12:17:16 -08:00
Prakhar Pratyush
1d1431297c initial_state_data: Add support for empty topic name.
This commit is a part of the work to support empty string
as a topic name.

Previously, empty string was not a valid topic name.

Adds backward compatibility for topic names in `user_topics`
objects returned in `/register` response.
2025-01-07 17:24:00 -08:00