GoToSocial's interaction policies are honoured

A remote post's canReply, canLike and canAnnounce (with the older always and approvalRequired) are kept beside
canQuote and judged for each persona: let in at once when the rule names the public, the persona, the author's
followers while it follows the author, or the accounts the author follows while the author follows it; asked first
when only the manual list names it; refused (422) otherwise. Asked first, a ReplyRequest, LikeRequest or
AnnounceRequest with the interaction as its instrument goes to the author alone, and the interaction waits
(privapub.approval: pending). The author's Accept brings an authorization, verified on the author's origin as naming the
interaction and the post; the reply then goes out with replyAuthorization, the boost with announceAuthorization, the
like with likeAuthorization. A Reject leaves the reply ours alone and takes a like or a boost back. As a third party, a
reply a policy does not let in at once is kept only with an authorization that verifies. Clients see the rules as
GoToSocial's interaction_policy.

Checked live against GoToSocial 0.22.1: the scenario's nine new checks pass (64 in all), a reply and a like approved
through its interaction requests and a boost refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-05 11:43:58 +02:00
1 parent c65a44ba88
commit 5860b71223
21 files changed
+687 -26

No files matched your search

+11
View File
@@ -70,6 +70,17 @@ namespace PrivaPub.Models.Post
public int QuotesCount { get; set; }
[BsonIgnoreIfNull]
public InteractionRule QuotePolicy { get; set; }//a remote post's interactionPolicy.canQuote; null when it states none
// a remote post's interactionPolicy.canReply, canLike and canAnnounce (GoToSocial); null when it states none, which
// means anyone, automatically
[BsonIgnoreIfNull]
public InteractionRule ReplyPolicy { get; set; }
[BsonIgnoreIfNull]
public InteractionRule LikePolicy { get; set; }
[BsonIgnoreIfNull]
public InteractionRule AnnouncePolicy { get; set; }
// our reply or boost of a remote post whose policy asks its author first, and the author's authorization once given
public ApprovalState Approval { get; set; }
public string ApprovalURI { get; set; }
public List<string> To { get; set; } = new();
public List<string> Cc { get; set; } = new();
+9
View File
@@ -23,6 +23,15 @@
public int Votes { get; set; }
}
// an interaction of ours with a remote post whose interaction policy asks its author first
public enum ApprovalState
{
None,
Pending,
Accepted,
Rejected
}
public class InteractionRule
{
public List<string> Automatic { get; set; } = new();//actor or collection URIs; Public for anyone
+2
View File
@@ -8,6 +8,8 @@ namespace PrivaPub.Models.Social
public string ActorURI { get; set; }
public string PostId { get; set; }
public string ActivityURI { get; set; }
public Post.ApprovalState Approval { get; set; }//ours, on a post whose policy asks its author first
public string ApprovalURI { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
}
}