These users didn't consent to having their private data exported.
Therefore, correct handling of these users should involve scrubbing
their settings to just match the realm defaults.
Instead of making repeated calls to get_consented_user_ids, we can just
fetch it (mostly) once and put it in
`context["exportable_user_ids"]`. This is essentially what the
(unused until now) exportable_user_ids logic was added for after all.
The added, intended, effect of this is that non-consenting users will
now get exported as mirror dummy accounts, due to the handling of
non-exportable users in `custom_fetch_user_profile`.
The remaining additional call to `get_consented_user_ids` is in
`fetch_usermessages`. This one is tricky as this function gets called
in subprocesses via
`zerver/management/commands/export_usermessage_batch.py` management
command invoked by the export process.
It requires passing the `exportable_user_ids` in some other way. This
can be dealt with in upcoming commits.
We shouldn't export the entire Client table - it includes Clients for
all the realms on the server, completely unrelated to the realm we're
exporting. Since these contain parts of the UserAgents used by the
users, we should treat these as private data and only export the Clients
that the specific data we're exporting "knows" about.
We already do this in computed_settings.py, but only if the
S3 (secret) key is set. Those aren't required to be set, and tusd
_requires_ a region, so we try again to suss it out here.
(cherry picked from commit 9c043c6c14)
Show `You are not subscribed to #xyz. Subscribe` bookend
on channel or topic which are not subscribed and have no messages.
Fixes: #33209
(cherry picked from commit 4696c8eb67)
This commit ensures that the user emoji in the search pill
is correctly aligned with the search text. The issue was
caused by improper line height, leading to the emoji being
slightly cut off at the top. Adjusting the `line-height`
of `.pill-value` resolves this, providing a consistent
and visually balanced appearance.
(cherry picked from commit 1b260c9fd7)
Currently, imported direct messages from third-party exports might have
a non-empty string as their topic name.
This migration updates the topic names for all imported third-party DMs
and GDMs to an empty string if they aren’t already.
Fixes#29466.
Co-authored-by: Pieter CK <pieterceka123@gmail.com>
(cherry picked from commit f6b3d59c35)
Currently, threads in Slack direct messages will increment the
`thread_counter` variable inside the thread conversion logic. Since we
don't treat thread messages in Slack DMs differently than any other DM,
threads in DM will only falsely increment the thread topic names in
channels.
This adds a condition that checks if the Slack message is a DM or not
before executing the thread conversion logic.
(cherry picked from commit d5e28bcd28)
Previously, `build_message` sets a message's topic name to the given
topic name, regardless of whether the message was a direct message (DM)
or a group direct message (GDM).
This change adds the `is_private` parameter to `build_message`. If
`is_private` is `True`, the `topic_name` will be overridden to an empty
string (""). Consequently, this also updates the third-party importers
to pass this parameter when calling `build_message`.
Co-authored-by: Pieter CK <pieterceka123@gmail.com>
(cherry picked from commit 845f0d40e1)
When on_compose_select_recipient_update is called when we start
the compose box actions, then it subsequently calls
compose_recipient.update_on_recipient_change.
If there is a specified topic in the opts for the compose box,
then that should be set for various functions that are called
in update_on_recipient_change.
compose_recipient.update_topic_displayed_text is called later for
all cases, direct messages and empty topics, which will update the
compose_state.topic again.
(cherry picked from commit d7873fbc11)
As the web app is now using the "with" operator for links to channel
topic conversations, we need to filter out that operator when
checking the current narrow state.
(cherry picked from commit 24a65c1783)
This commit renames "(no topic)" to "" when used as
topic name in `POST /typing`.
Message sent in "(no topic)" is translated as being
sent in "" by the server, so it makes sense to show
the typing notification in "" when message is being composed.
(cherry picked from commit d011fb0621)
We now use `data-user-group-id` to check if a banner for the same
group already exists, preventing duplicate warnings when the same
group is mentioned multiple times.
(cherry picked from commit 35289dfe51)
In dark theme, when clicking the "Add task" button of
todo and "Add option" button of poll, the background
color incorrectly turns white.
This commit removes the white background color of the
buttons and makes it consistent woth the other green
buttons.
(cherry picked from commit eef44429e2)
When a message is moved using the "Move only this message" option
a confirmation toast is shown. This commit adds support to show
"general chat" in link of the toast when a message is moved to it.
(cherry picked from commit 939691dfed)
Searching for a word that appears in a message in a empty string
topic via the search box resulted in a message view where the
topic names in the recipient_row were empty string instead of
`realm_empty_topic_display_name`.
This commit fixes that bug.
(cherry picked from commit 8383b11526)
This was likely a longstanding issue that wasn't
caught because we required topics on CZO. The new
logic ensures topic match even for empty string
(general chat) topics.
(cherry picked from commit 8a51fa4b83)
Earlier, for topic="" and mandatory_topics=False, the inline topic
edit input field width was not set correctly when the inline topic
edit was started for the first time.
This resulted in overflowing placeholder.
This commit fixes that bug.
(cherry picked from commit b53327dabe)
Showing this banner in every view can be annoying. As a first step,
we only show it in conversation view to reduce the banner spam.
(cherry picked from commit 6c81ff61ee)
Apparently, while we set our own maximum password length of 100
characters, zxcvbn had a hardcoded maximum length of 72 characters,
and threw an exception if that was exceeded.
The fact that we're discovering this now would suggest that nobody has
previously attempted a password between 72 and 100 characters in
length.
(cherry picked from commit 37b7a32eb4)
Refactors get_recipient_label so that it's a bit clearer what the
recipient_information parameter is for and what we do when that
parameter is undefined.
In doing so, we no longer treat the constructed objects, that are
passed as the recipient_information parameter, and actual Message
objects, that we get from the current message list view, as the
same thing.
(cherry picked from commit 7d3b77e490)
Both the inbox and recent conversation views pass information about
the reply recipient to this function's caller so that the button
text can be updated for the focused row.
Therefore, the check for an undefined current message list should
be inside the case where the recipient information parameter is
undefined.
This was changed in f630272b4c when non-message list views set
undefined for the current message list.
(cherry picked from commit 4f163e5ad2)
Renames ComposeClosedMessage to ReplyRecipientInformation, and
exports the type from compose_closed_ui.ts so that the functions
that construct these objects from the recent conversations and
inbox views have the type available.
Also, renames the variables for these objects to not be "message",
so that it's clear that these are not Message objects.
(cherry picked from commit b48134a03e)
Renames update_reply_recipient_label to
update_recipient_text_for_reply_button.
This better matches the function that sets the default text for
the closed compose box button: set_standard_text_for_reply_button.
(cherry picked from commit 94fe5fc173)
Instead of relying on different functions to get error messages,
we use `validate` to get the error message for the current compose
state.
This fixes a bug where compose tooltip was not defined when
compose state was not valid.
(cherry picked from commit 01c5197dd9)
We now use `disabled-message-send-controls` class to control
the disabled status of send button. So, this is not required.
(cherry picked from commit ad0b616bbd)
This is follow-up commit for d00b4cb0bd,
which updates the padding of the banner label and banner close button
to accommodate the previous font size change.
(cherry picked from commit 836e04fac8)
This commit converts the pixel values to em instead to make the banner
scale better with the different font sizes.
(cherry picked from commit bf88426cd1)
If there were no users found for `find_team`, we need to provide
a default langauge for the email as one cannot be extracted from
`UserProfile` in this case.
(cherry picked from commit e6dd79f241)
Performance remains the same whether we're using the bulk function
underneath the function in question or not, this helps us avoid
duplication.
(cherry picked from commit 2e48293e4b)
We want this function to just use the bulk function instead underneath,
we add a query count check here so that when we do that replace in the
next commit, we can make sure that the query count has not increased.
(cherry picked from commit 0570bfa90c)