Revert "Merge branch 'feature/split-hide-network' into 'develop'"
This reverts merge request !733
This commit is contained in:
parent
28bfb09b01
commit
486749064f
10 changed files with 45 additions and 88 deletions
|
|
@ -30,8 +30,7 @@ defmodule Pleroma.User.Info do
|
|||
field(:topic, :string, default: nil)
|
||||
field(:hub, :string, default: nil)
|
||||
field(:salmon, :string, default: nil)
|
||||
field(:hide_followers, :boolean, default: false)
|
||||
field(:hide_followings, :boolean, default: false)
|
||||
field(:hide_network, :boolean, default: false)
|
||||
field(:pinned_activities, {:array, :string}, default: [])
|
||||
|
||||
# Found in the wild
|
||||
|
|
@ -144,8 +143,7 @@ defmodule Pleroma.User.Info do
|
|||
:no_rich_text,
|
||||
:default_scope,
|
||||
:banner,
|
||||
:hide_followings,
|
||||
:hide_followers,
|
||||
:hide_network,
|
||||
:background
|
||||
])
|
||||
end
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ defmodule Pleroma.Web.ActivityPub.UserView do
|
|||
query = from(user in query, select: [:ap_id])
|
||||
following = Repo.all(query)
|
||||
|
||||
collection(following, "#{user.ap_id}/following", page, !user.info.hide_followings)
|
||||
collection(following, "#{user.ap_id}/following", page, !user.info.hide_network)
|
||||
|> Map.merge(Utils.make_json_ld_header())
|
||||
end
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ defmodule Pleroma.Web.ActivityPub.UserView do
|
|||
"id" => "#{user.ap_id}/following",
|
||||
"type" => "OrderedCollection",
|
||||
"totalItems" => length(following),
|
||||
"first" => collection(following, "#{user.ap_id}/following", 1, !user.info.hide_followings)
|
||||
"first" => collection(following, "#{user.ap_id}/following", 1, !user.info.hide_network)
|
||||
}
|
||||
|> Map.merge(Utils.make_json_ld_header())
|
||||
end
|
||||
|
|
@ -109,7 +109,7 @@ defmodule Pleroma.Web.ActivityPub.UserView do
|
|||
query = from(user in query, select: [:ap_id])
|
||||
followers = Repo.all(query)
|
||||
|
||||
collection(followers, "#{user.ap_id}/followers", page, !user.info.hide_followers)
|
||||
collection(followers, "#{user.ap_id}/followers", page, !user.info.hide_network)
|
||||
|> Map.merge(Utils.make_json_ld_header())
|
||||
end
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ defmodule Pleroma.Web.ActivityPub.UserView do
|
|||
"id" => "#{user.ap_id}/followers",
|
||||
"type" => "OrderedCollection",
|
||||
"totalItems" => length(followers),
|
||||
"first" => collection(followers, "#{user.ap_id}/followers", 1, !user.info.hide_followers)
|
||||
"first" => collection(followers, "#{user.ap_id}/followers", 1, !user.info.hide_network)
|
||||
}
|
||||
|> Map.merge(Utils.make_json_ld_header())
|
||||
end
|
||||
|
|
|
|||
|
|
@ -605,7 +605,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
|||
followers =
|
||||
cond do
|
||||
for_user && user.id == for_user.id -> followers
|
||||
user.info.hide_followers -> []
|
||||
user.info.hide_network -> []
|
||||
true -> followers
|
||||
end
|
||||
|
||||
|
|
@ -621,7 +621,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
|||
followers =
|
||||
cond do
|
||||
for_user && user.id == for_user.id -> followers
|
||||
user.info.hide_followings -> []
|
||||
user.info.hide_network -> []
|
||||
true -> followers
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -503,7 +503,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
followers =
|
||||
cond do
|
||||
for_user && user.id == for_user.id -> followers
|
||||
user.info.hide_followers -> []
|
||||
user.info.hide_network -> []
|
||||
true -> followers
|
||||
end
|
||||
|
||||
|
|
@ -523,7 +523,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
friends =
|
||||
cond do
|
||||
for_user && user.id == for_user.id -> friends
|
||||
user.info.hide_followings -> []
|
||||
user.info.hide_network -> []
|
||||
true -> friends
|
||||
end
|
||||
|
||||
|
|
@ -618,7 +618,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|
|||
|
||||
defp build_info_cng(user, params) do
|
||||
info_params =
|
||||
["no_rich_text", "locked", "hide_followers", "hide_followings"]
|
||||
["no_rich_text", "locked", "hide_network"]
|
||||
|> Enum.reduce(%{}, fn key, res ->
|
||||
if value = params[key] do
|
||||
Map.put(res, key, value == "true")
|
||||
|
|
|
|||
|
|
@ -108,8 +108,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
|
|||
"locked" => user.info.locked,
|
||||
"default_scope" => user.info.default_scope,
|
||||
"no_rich_text" => user.info.no_rich_text,
|
||||
"hide_followers" => user.info.hide_followers,
|
||||
"hide_followings" => user.info.hide_followings,
|
||||
"hide_network" => user.info.hide_network,
|
||||
"fields" => fields,
|
||||
|
||||
# Pleroma extension
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue