implement invisible support for remote users
This commit is contained in:
parent
95871cb462
commit
ef659331b0
7 changed files with 95 additions and 7 deletions
|
|
@ -596,13 +596,20 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
data,
|
||||
_options
|
||||
)
|
||||
when object_type in ["Person", "Application", "Service", "Organization"] do
|
||||
when object_type in [
|
||||
"Person",
|
||||
"Application",
|
||||
"Service",
|
||||
"Organization",
|
||||
["Application", "Invisible"]
|
||||
] do
|
||||
with %User{ap_id: ^actor_id} = actor <- User.get_cached_by_ap_id(object["id"]) do
|
||||
{:ok, new_user_data} = ActivityPub.user_data_from_user_object(object)
|
||||
|
||||
banner = new_user_data[:info][:banner]
|
||||
locked = new_user_data[:info][:locked] || false
|
||||
attachment = get_in(new_user_data, [:info, :source_data, "attachment"]) || []
|
||||
invisible = new_user_data[:info][:invisible] || false
|
||||
|
||||
fields =
|
||||
attachment
|
||||
|
|
@ -612,7 +619,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
|
|||
update_data =
|
||||
new_user_data
|
||||
|> Map.take([:name, :bio, :avatar])
|
||||
|> Map.put(:info, %{banner: banner, locked: locked, fields: fields})
|
||||
|> Map.put(:info, %{banner: banner, locked: locked, fields: fields, invisible: invisible})
|
||||
|
||||
actor
|
||||
|> User.upgrade_changeset(update_data, true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue