mcurl -o /dev/null -X POST -H "$MH""$M/api/v1/statuses/$m_post_id/pin"
until_true 45'[ "$(p_pinned $pinner_on_p)" = "$m_post_uri" ]'&& ok "pinner's pin shows on its profile here"|| ko "pinner's pin never arrived ($(p_pinned $pinner_on_p))"
mcurl -o /dev/null -X POST -H "$MH""$M/api/v1/statuses/$m_post_id/unpin"
until_true 45'[ -z "$(p_pinned $pinner_on_p)" ]'&& ok "and its unpin takes it off"|| ko "pinner's unpin never arrived"
echo" alice pins"
p_post=$(curl -s -X POST -H "$PH""$P/api/v1/statuses" -d "status=a PrivaPub post worth pinning $run&visibility=public")
until_true 45'[ "$(mcurl -H "$MH" "$M/api/v1/accounts/$alice_on_m/statuses?limit=5" | j "print(any(s[\"uri\"] == \"$p_post_uri\" for s in d))")" = "True" ]'
curl -s -o /dev/null -X POST -H "$PH""$P/api/v1/statuses/$p_post_id/pin"
until_true 45'[ "$(m_pinned $alice_on_m)" = "$p_post_uri" ]'&& ok "alice's pin shows on her profile on Mastodon"|| ko "alice's pin never reached Mastodon ($(m_pinned $alice_on_m))"
curl -s -o /dev/null -X POST -H "$PH""$P/api/v1/statuses/$p_post_id/unpin"
until_true 45'[ -z "$(m_pinned $alice_on_m)" ]'&& ok "and her unpin takes it off"|| ko "alice's unpin never reached Mastodon"
echo" pins made before"
# a fresh account pins first; PrivaPub reads its featured collection when it first fetches it
early="early$run"
mastodon_user "$early"
ET=$(mastodon_token "$early")
e_post=$(mcurl -X POST -H "Authorization: Bearer $ET""$M/api/v1/statuses" -d "status=pinned before anyone looked $run&visibility=public")
# alice follows the fresh account: its outbox's latest public posts come to its profile here (OutboxBackfill)
e_other=$(mcurl -X POST -H "Authorization: Bearer $ET""$M/api/v1/statuses" -d "status=written before anyone followed $run&visibility=public"| j "print(d['uri'])")
curl -s -o /dev/null -X POST -H "$PH""$P/api/v1/accounts/$early_on_p/follow"
until_true 60'[ "$(curl -s -H "$PH" "$P/api/v1/accounts/$early_on_p/statuses?limit=40" | j "print(any(s[\"uri\"] == \"$e_other\" for s in d))")" = "True" ]'\
&& ok "following an account brings its earlier posts to its profile"|| ko "the account's earlier posts never came"