hide_follows: user.info.hide_follows,
hide_favorites: user.info.hide_favorites,
relationship: relationship,
- skip_thread_containment: user.info.skip_thread_containment
+ skip_thread_containment: user.info.skip_thread_containment,
+ background_image: image_url(user.info.background) |> MediaProxy.url()
}
}
|> maybe_put_role(user, opts[:for])
end
defp maybe_put_notification_settings(data, _, _), do: data
+
+ defp image_url(%{"url" => [%{"href" => href} | _]}), do: href
+ defp image_url(_), do: nil
end
]
}
+ background_image = %{
+ "url" => [%{"href" => "https://example.com/images/asuka_hospital.png"}]
+ }
+
user =
insert(:user, %{
- info: %{note_count: 5, follower_count: 3, source_data: source_data},
+ info: %{
+ note_count: 5,
+ follower_count: 3,
+ source_data: source_data,
+ background: background_image
+ },
nickname: "shp@shitposter.club",
name: ":karjalanpiirakka: shp",
bio: "<script src=\"invalid-html\"></script><span>valid html</span>",
pleroma: %{}
},
pleroma: %{
+ background_image: "https://example.com/images/asuka_hospital.png",
confirmation_pending: false,
tags: [],
is_admin: false,
pleroma: %{}
},
pleroma: %{
+ background_image: nil,
confirmation_pending: false,
tags: [],
is_admin: false,
pleroma: %{}
},
pleroma: %{
+ background_image: nil,
confirmation_pending: false,
tags: [],
is_admin: false,