UX: Split hide_profile_and_presence user option (#29632)

It splits the hide_profile_and_presence user option and the default_hide_profile_and_presence site setting for more granular control. It keeps the option to hide the profile under /u/username/preferences/interface and adds the presence toggle in the quick user menu.

Co-authored-by: Régis Hanol <regis@hanol.fr>
This commit is contained in:
Jan Cernik
2024-11-12 22:22:58 -03:00
committed by GitHub
parent d637bd6519
commit 234133bd3b
35 changed files with 179 additions and 63 deletions

View File

@ -260,7 +260,7 @@ export default class Chat extends Service {
return;
}
if (this.currentUser.user_option?.hide_profile_and_presence) {
if (this.currentUser.user_option?.hide_presence) {
return;
}

View File

@ -68,7 +68,7 @@ describe UsersController do
before { sign_in(user) }
it "returns that the user can message themselves" do
user.user_option.update!(hide_profile_and_presence: false)
user.user_option.update!(hide_profile: false)
user.user_option.update!(chat_enabled: true)
get "/u/#{user.username}/card.json"
expect(response).to be_successful
@ -76,7 +76,7 @@ describe UsersController do
end
it "returns that the user can message themselves when the profile is hidden" do
user.user_option.update!(hide_profile_and_presence: true)
user.user_option.update!(hide_profile: true)
user.user_option.update!(chat_enabled: true)
get "/u/#{user.username}/card.json"
expect(response).to be_successful
@ -87,7 +87,7 @@ describe UsersController do
context "when hidden users" do
before do
sign_in(another_user)
user.user_option.update!(hide_profile_and_presence: true)
user.user_option.update!(hide_profile: true)
end
it "returns the correct partial response when the user has chat enabled" do

View File

@ -21,7 +21,7 @@ describe Chat::ChatablesSerializer do
end
context "with hidden profile" do
before { user_1.user_option.update!(hide_profile_and_presence: true) }
before { user_1.user_option.update!(hide_profile: true) }
it "doesn’t include status" do
serializer =