Replies a post's author approves (FEP-5624), checked live with PeerTube
PeerTube puts canReply on a video whose comments wait for approval, and answers each comment with ApproveReply. A persona's reply to such a post now waits (privapub.approval: pending), its Create going to the author alone; the author's ApproveReply, signed by the author and naming the post answered, lets it out to its audience with replyApproval, and RejectReply leaves it ours. A null canReply (PeerTube's open comments) says nothing; an empty one refuses. The PeerTube scenario holds a comment for review and approves it through PeerTube's API (28 checks). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
5d5f1d6909
commit
a3a66b6db2
17 files changed
+256
-25
No files matched your search
@@ -1,5 +1,6 @@
|
||||
# PeerTube 8.3: a persona follows a channel; the channel's video arrives as a playable post, its file streamed through
|
||||
# PrivaPub's media proxy with byte ranges; comments both ways thread; a like counts and its undo too; the video's edit
|
||||
# PrivaPub's media proxy with byte ranges; comments both ways thread; a comment on a video whose comments are moderated
|
||||
# waits for the owner's approval (FEP-5624); a like counts and its undo too; the video's edit
|
||||
# and its deletion reach PrivaPub; statistics. PeerTube's users follow channels and accounts of PeerTube-like servers
|
||||
# only, so nothing here has PeerTube following a persona.
|
||||
PTB=https://peertube.test:6443
|
||||
@@ -46,12 +47,13 @@ until_true 30 '[ "$(pcurl -H "$TH" "$PTB/api/v1/video-channels/$channel/follower
|
||||
&& ok "PeerTube lists alice_peertube among the channel's followers" || ko "PeerTube does not list the follower"
|
||||
|
||||
echo " videos"
|
||||
run=$(date +%s)
|
||||
video=$(pcurl -X POST -H "$TH" "$PTB/api/v1/videos/upload" -F "videofile=@$here/town/media/tiny.mp4;type=video/mp4" \
|
||||
-F "channelId=$channel_id" -F "name=Hello PrivaPub from PeerTube" -F "description=a tiny test video" -F privacy=1 -F commentsPolicy=1 -F waitTranscoding=false)
|
||||
-F "channelId=$channel_id" -F "name=Hello PrivaPub from PeerTube $run" -F "description=a tiny test video" -F privacy=1 -F commentsPolicy=1 -F waitTranscoding=false)
|
||||
video_id=$(echo "$video" | j "print(d['video']['shortUUID'])")
|
||||
[ -n "$video_id" ] && ok "ptuser uploads a video" || ko "upload refused: $(echo "$video" | head -c 200)"
|
||||
until_true 60 '[ -n "$(p_home_id "Hello PrivaPub from PeerTube")" ]' && ok "the video reaches alice_peertube's home, boosted by its channel" || ko "the video never arrived"
|
||||
v_on_p=$(p_home_id "Hello PrivaPub from PeerTube")
|
||||
until_true 60 '[ -n "$(p_home_id "Hello PrivaPub from PeerTube $run")" ]' && ok "the video reaches alice_peertube's home, boosted by its channel" || ko "the video never arrived"
|
||||
v_on_p=$(p_home_id "Hello PrivaPub from PeerTube $run")
|
||||
v_status=$(curl -s -H "$PH" "$P/api/v1/statuses/$v_on_p")
|
||||
[ "$(echo "$v_status" | j "print(d['media_attachments'][0]['type'])")" = "video" ] && ok "the video is a playable attachment" || ko "no video attachment: $(echo "$v_status" | j "print(d['media_attachments'])" | head -c 200)"
|
||||
v_file=$(echo "$v_status" | j "print(d['media_attachments'][0]['url'])")
|
||||
@@ -71,6 +73,29 @@ pcurl -o /dev/null -X POST -H "$TH" -H 'Content-Type: application/json' "$PTB/ap
|
||||
until_true 30 '[ "$(curl -s -H "$PH" "$P/api/v1/statuses/$v_on_p/context" | j "print(any(\"thank you from PeerTube\" in s[\"content\"] for s in d[\"descendants\"]))")" = "True" ]' \
|
||||
&& ok "ptuser's answer threads under the video on PrivaPub" || ko "PeerTube's answer missing from the thread"
|
||||
|
||||
echo " moderated comments"
|
||||
# a video whose comments wait for approval (FEP-5624's canReply): alice's comment waits, goes to PeerTube alone, and is let
|
||||
# in by ptuser's approval (ApproveReply), after which PeerTube shows it
|
||||
held=$(date +%s)
|
||||
mvideo=$(pcurl -X POST -H "$TH" "$PTB/api/v1/videos/upload" -F "videofile=@$here/town/media/tiny.mp4;type=video/mp4" \
|
||||
-F "channelId=$channel_id" -F "name=A moderated video $held" -F "description=comments wait here" -F privacy=1 -F commentsPolicy=3 -F waitTranscoding=false \
|
||||
| j "print(d['video']['shortUUID'])")
|
||||
until_true 60 '[ -n "$(p_home_id "A moderated video $held")" ]' >/dev/null
|
||||
m_on_p=$(p_home_id "A moderated video $held")
|
||||
m_reply=$(curl -s -X POST -H "$PH" $P/api/v1/statuses -d "status=@ptuser@peertube.test a comment to approve $held&in_reply_to_id=$m_on_p&visibility=public" | j "print(d['id'])")
|
||||
[ "$(curl -s -H "$PH" "$P/api/v1/statuses/$m_reply" | j "print((d.get('privapub') or {}).get('approval'))")" = "pending" ] \
|
||||
&& ok "alice's comment on a moderated video waits for its approval" || ko "alice's comment on a moderated video does not wait"
|
||||
# (its owner sees it in the video's threads, held for review; PeerTube 8.3's list of held comments answers 500)
|
||||
pt_held() { pcurl -H "$TH" "$PTB/api/v1/videos/$mvideo/comment-threads" | j "print(next((c['id'] for c in d['data'] if c.get('heldForReview') and 'approve $held' in c['text']), ''))"; }
|
||||
until_true 30 '[ -n "$(pt_held)" ]' && ok "PeerTube holds it for review" || ko "PeerTube never held alice's comment"
|
||||
held_id=$(pt_held)
|
||||
pcurl -o /dev/null -X POST -H "$TH" "$PTB/api/v1/videos/$mvideo/comments/$held_id/approve"
|
||||
until_true 30 '[ "$(curl -s -H "$PH" "$P/api/v1/statuses/$m_reply" | j "print((d.get(\"privapub\") or {}).get(\"approval\"))")" = "None" ]' \
|
||||
&& ok "ptuser's approval (ApproveReply) lets alice's comment in" || ko "the approval never reached PrivaPub"
|
||||
[ "$(pcurl "$PTB/api/v1/videos/$mvideo/comment-threads" | j "print(any('a comment to approve $held' in c['text'] for c in d['data']))")" = "True" ] \
|
||||
&& ok "PeerTube shows the approved comment" || ko "PeerTube does not show the approved comment"
|
||||
pcurl -o /dev/null -X DELETE -H "$TH" "$PTB/api/v1/videos/$mvideo"
|
||||
|
||||
echo " likes"
|
||||
curl -s -o /dev/null -X POST -H "$PH" "$P/api/v1/statuses/$v_on_p/favourite"
|
||||
until_true 30 '[ "$(pcurl "$PTB/api/v1/videos/$video_id" | j "print(d[\"likes\"])")" = "1" ]' && ok "alice_peertube's like counts on PeerTube" || ko "like not counted on PeerTube"
|
||||
|
||||
Reference in new issue
Block a user