Commit Graph

60702 Commits

Author SHA1 Message Date
evykassirer c02f4ff941 message_list_view: Calculate message_container_variables without the container.
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
2024-09-10 17:20:00 -07:00
evykassirer df6d592d1c message_list_view: Calculate message_edited_vars from just the message.
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
2024-09-10 17:20:00 -07:00
evykassirer e40efcc390 message_list_view: Get topic edit properties instead of mutating group.
This is part of a bigger refactor to calculate message list group
attributes and creating the group all at once instead of piecewise.
This is necessary to convert this module to typescript, since a
partially formed group is hard to type.
2024-09-10 17:20:00 -07:00
evykassirer 541228f817 message_list_view: Only pass messages to update_group_date.
This is part of a bigger refactor to calculate message container
attributes just from the message, so that we can create the message
container all at once instead of piecewise, to be able to convert
to typescript.
2024-09-10 17:20:00 -07:00
evykassirer 71d01291b6 message_list_view: Replace util.same_sender with sender_id check. 2024-09-10 17:20:00 -07:00
evykassirer b387ad24fa timerender: Move util.the into render_date. 2024-09-10 17:20:00 -07:00
Mateusz Mandera b572b1536a test_retention: Delete irrelevant comment.
This comment is clearly out of place and at this point doesn't match any
of the classes in a useful way.
2024-09-10 17:07:47 -07:00
Mateusz Mandera ce5439d87f retention: Remove outdated compat block for delete_message events.
As noted in the comment in that block, this is no longer useful.
2024-09-10 17:07:47 -07:00
roanster007 bc384094d3 narrow: Make `with` operator behaviour consistent with API behaviour.
Previously, in presence of `dm` operators, the `with` operator
behaviour in the web client was not consistent with that of
the API. For instance, when `with` points to a stream message,
in presence of a `dm` term, then rather than narrowing to the
corresponding channel of `with` operand, the `with` term simply
used to be ignored, and narrowed to the corresponding `dm`
narrow.

Also, in cases when the `with` used to point to a direct message,
in presence of a `channel` term, then after correcting to the
right narrow, the `with` term used to be removed. The `with`
term would still be needed after correcting the narrow to
maintain consistency between channel and dm conversations.

This commit removes these inconsistencies of `with` in case
of `dm` operators, and makes it consistent to those mentioned
in the api documentation.
2024-09-10 16:29:49 -07:00
opmkumar 719518baba popovers: Add stream-info-popover when channel pill is clicked.
Shows a stream info popover whenever a channel pill is clicked (such
as in the pill widgets for adding subscribers to a channel or
invitations). The stream info popover contains channel icon and name,
channel description and a link to channel settings.

Fixes #30567.
2024-09-10 16:16:53 -07:00
opmkumar 5ecdf56336 popovers: Fix references to nonexistant popover-menu-inner-list-item.
These should have been popover-menu-list-item.
2024-09-10 16:16:53 -07:00
Varun Singh d6c34f64dd tests: Use `make_user` & `make_bot` to create test user & bot. 2024-09-10 16:02:35 -07:00
Varun Singh f9f2c32d21 example_user: Add helper functions to create user. 2024-09-10 16:02:35 -07:00
Varun Singh 4c2bb4dbe3 tests: Rename `test_stream.js` to `example_stream.js`. 2024-09-10 16:02:35 -07:00
Tim Abbott ad890890f6 lint: Fix several duplicate word typos. 2024-09-10 15:59:00 -07:00
Aman Agrawal 21b6bb9887 message_list_data_cache: Update when receiving new messages.
If we receive a message that we can add to the data cache without
talking to the server, we do that, otherwise we remove it from the
cache to avoid us having wrong filter status cached.
2024-09-10 15:58:15 -07:00
Aman Agrawal 5b9a2584c5 message_list_data_cache: Cache MessageListData objects.
We start caching MessageListData objects for the narrows which
user has visited. We restore the cached objects if the filters
match. Also, the cached objects are updated based on events. One
major piece is update path the is pending implementation is the
message move code path.
2024-09-10 15:58:15 -07:00
Aman Agrawal 259e77fbf6 message_list_data: Track if the data is rendered using message list id.
This is an easy way to track if a MessageListData is rendered.
Storing MessageList object would make us liable to cleanup the
MessageList object when the data is no longer in use.

Note that this is more like "likely / past rendered message list id",
we will have to check currently rendered message list data to verify
if the data object is really rendered.
2024-09-10 15:58:15 -07:00
Aman Agrawal fee108949d messsage_lists: Extract method to delete a rendered list. 2024-09-10 15:58:15 -07:00
Ikko Eltociear Ashimine 0507f65da5
realm_settings: Fix duplicate word typos in comments. 2024-09-10 15:55:14 -07:00
joseph 65893292b5 channel_subscribe: Use IDs instead of emails when processing results.
As part of our todo in the code, we want to use the unique user IDs
instead of emails when processing the results of subscribing users to a
channel. These changes apply those changes and streamlines the use of IDs.
2024-09-10 15:37:38 -07:00
opmkumar 62f74fcb83 search: Hide close button in empty filter streams and filter topics.
Fixes #21297.
2024-09-10 15:36:30 -07:00
Bedo Khaled ad2ef71320
translation: Add new tip to Spanish translation guide. 2024-09-10 14:51:54 -07:00
Karl Stolley 8ff3fb5fec message_row: Reduce space above collapsed Show More button.
This only impacts collapsed Show More buttons in a message with a
sender.

Fixes #31221
2024-09-10 14:06:58 -07:00
adnan-td eaaf26e182 buddy_list: Remove deactivated users from right sidebar.
Filter out inactive people from the buddy list in the right
sidebar.
2024-09-10 14:04:26 -07:00
Mateusz Mandera a36f906d1a presence: Add history_limit_days param to the API.
This param allows clients to specify how much presence history they want
to fetch. Previously, the server always returned 14 days of history.
With the recent migration of the presence API to the much more efficient
system relying on incremental fetches via the last_update_id param added
in #29999, we can now afford to provide much more history to clients
that request it - as all that historical data will only be fetched once.

There are three endpoints involved:
- `/register` - this is the main useful endpoint for this, used by API
clients to fetch initial data and register an events queue. Clients can
pass the `presence_history_limit_days` param here.
- `/users/me/presence` - this endpoint is currently used by clients to
update their presence status and fetch incremental data, making the new
functionality not particularly useful here. However, we still add the
new `history_limit_days` param here, in case in the future clients
transition to using this also for the initial presence data fetch.
- `/` - used when opening the webapp. Naturally, params aren't passed
here, so the server just assumes a value from
`settings.PRESENCE_HISTORY_LIMIT_DAYS_FOR_WEB_APP` and returns
information about this default value in page_params.
2024-09-10 13:15:35 -07:00
Mateusz Mandera 6ce096c0ff zerver: Rename some message_type variables to recipient_type. 2024-09-10 12:50:28 -07:00
Mateusz Mandera 8505de7b19 populate_db: Rename message_type to recipient_type. 2024-09-10 12:50:28 -07:00
Aman Agrawal 93f0581197 messages_overlay: Fix multiple IDs selected accidentally.
Since `success_message_scheduled_banner` and scheduled message overlay
both use `data-scheduled-message-id`, `get_element_by_id` needs
to be more specific which selector it wants.
2024-09-10 09:51:18 -07:00
Prakhar Pratyush e8349aa5d7 custom_email: Add manage_preferences block to the plaintext version.
Earlier, the content of the "manage_preferences" block that includes
the unsubscribe_link, personal settings link, etc was missing in the
plaintext version of the custom emails.

This commit updates the logic to include the manage_preferences block
content in the plaintext version.
2024-09-10 09:36:56 -07:00
Prakhar Pratyush e967226f8c remote_server_email: Add 'unsubscribe link' in the mail footer.
Previously, the emails sent to the remote servers had the
'unsubscribe link' only present in the 'List-Unsubscribe' header.

Not all email clients expose that header.

So, this commit adds the link in the footer too.
2024-09-10 09:36:56 -07:00
Prakhar Pratyush 00fb8f3014 settings: Move the user-privacy settings related code at one place.
This commit makes small refactoring to place all the user-privacy
settings code in 'server_events_dispatch.js' at one place and use
a common function 'settings_account.update_privacy_settings_box' to
update the UI.

This also helps in early return instead of executing a lot
of `if` statements related to user-preferences settings.
2024-09-10 09:34:24 -07:00
Prakhar Pratyush 75f6ae6d20 settings: Fix live-update bug for privacy settings.
The following three privacy settings weren't being live
updated across multiple browser tabs/windows:
* send_stream_typing_notifications
* send_private_typing_notifications
* send_read_receipts

This commit fixes the bug.
2024-09-10 09:34:24 -07:00
Prakhar Pratyush 340140954b settings: Use the generic code block to set 'enter_sends' value.
This commit performs a minor code restructuring to use the
generic code block for updating all the user_preferences
settings values.

No need to use a separate code block for 'enter_sends' setting.
2024-09-10 09:34:24 -07:00
Vector73 eacf54d52d test_realm: Fix `test_invalid_integer_attribute_values`.
Fixes test that checks for error when invalid value is given for a property
in realm. Currently, only properties with type int are checked, leaving
properties having optional int type. This commit fixes that.
2024-09-10 09:32:33 -07:00
Alex Vandiver 8bacdbc895 thumbnail: Put the original dimensions on spinner images.
This lets us reserve the right amount of space in the message feed
immediately.
2024-09-09 15:59:02 -07:00
Tim Abbott f757f5f5f8 api_docs: Document feature level 286. 2024-09-09 15:59:02 -07:00
Alex Vandiver 64a16dd9b4 kandra: We do not serve staging from staging.zulip.com:80.
It is not configured in the ALB's rules, nor does the ALB ever forward
to port 80.
2024-09-09 15:17:19 -07:00
Alex Vandiver 56ca594abf upload: Preserve content-type from upload for local-file storage.
Now that we store the content-type in the database, use that value
(if we have it, since we did not backfill) when serving content back
to the client.  This means the file backend has parity with the S3
backend.
2024-09-09 12:40:17 -07:00
Alex Vandiver d7ebe7296d test_upload: Switch to SimpleUploadedFile. 2024-09-09 12:40:17 -07:00
Alex Vandiver 485e235719 test_upload: Remove an incorrect comment.
S3 uploads are now (after 04cf68b45e) handled like local uploads
were -- no redirects are used.
2024-09-09 12:40:17 -07:00
Alex Vandiver 8bd94b82bf upload: Name the link based on the uploaded filename.
We previously parsed the filename as stored on disk, which is rather
sanitized.  Use as close to the original filename as possible.
2024-09-09 12:40:17 -07:00
Alex Vandiver 8e5cdcc174 upload: Remove impossible undefined-url test and code.
This came in during the initial conversion to Uppy in 5bab2a3762,
but it tests a case which should not be possible according to Uppy's
API, and ours.
2024-09-09 12:40:17 -07:00
Alex Vandiver 903bfb31e6 upload: Provide the frontend with the less-modified filename. 2024-09-09 12:40:17 -07:00
Alex Vandiver b4764f49df upload: Download files with their original names.
Fixes: #29491.
2024-09-09 12:40:17 -07:00
Alex Vandiver 933e3cb375 upload: Explicitly return a bool and the Attachment object. 2024-09-09 12:40:17 -07:00
Alex Vandiver 0b0a7fa251 attachments: Tighten type of validate_attachment_request_for_spectator_access. 2024-09-09 12:40:17 -07:00
Alex Vandiver ca72e756eb upload: Rename "upload_image_to_s3"; it is not only for images. 2024-09-09 12:40:17 -07:00
Alex Vandiver c8c480baef mattermost: Handle duplicate dm-groups.
Observed in the wild, cause unknown.

Partially fixes: #24131.

Co-authored-by: Mateusz Mandera <mateusz.mandera@zulip.com>
2024-09-09 12:05:28 -07:00
Alex Vandiver 989d425023 users: Soften assumptions that all bots have owners.
Imported Slack bots currently do not have owners (#23145).  Soften the
deactivation codepath to allow them to be successfully deactivated
despite this.

Co-authored-by: Mateusz Mandera <mateusz.mandera@zulip.com>
2024-09-09 11:55:46 -07:00