fix(patches): force unlisted visibility on OwnYourSwarm checkin posts

OwnYourSwarm sends visibility:"private" which Indiekit doesn't recognise,
causing checkin posts to slip through syndication and AP federation guards.
Remove the !hasVisibility condition so checkins are always forced to
"unlisted" regardless of what OwnYourSwarm sends.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sven
2026-03-18 19:49:10 +01:00
parent 1ad3bae3fc
commit 3c8c027f5d

View File

@@ -17,9 +17,11 @@ const newCode = ` // Post type
const type = getPostType(postTypes, properties);
properties["post-type"] = type;
// Default OwnYourSwarm /where check-in notes to unlisted unless explicitly set.
// Force OwnYourSwarm /where check-in notes to unlisted so they are
// hidden from the blog, syndication targets, and ActivityPub federation.
// OwnYourSwarm may send visibility:"private" which Indiekit does not
// recognise, so we always override to "unlisted" for these posts.
const hasCheckinProperty = Object.prototype.hasOwnProperty.call(properties, "checkin");
const hasVisibility = Object.prototype.hasOwnProperty.call(properties, "visibility");
const syndicationValues = Array.isArray(properties.syndication)
? properties.syndication
: properties.syndication
@@ -31,7 +33,6 @@ const newCode = ` // Post type
if (
type === "note" &&
!hasVisibility &&
(hasCheckinProperty || hasSwarmSyndication)
) {
properties.visibility = "unlisted";