Ignore:
Timestamp:
06/27/2026 07:51:44 AM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
92f6976
Parents:
aa45208
Message:

feat(posts): NSFW / sensitive content

Mark a post NSFW (checkbox in the editor, available to all). On-site the cover blurs in
feed/grid and the whole post blurs behind a 'Gevoelige inhoud' banner until clicked. In the
fediverse the Note gets sensitive:true + a content-warning summary (Mastodon CW). i18n NL/EN/DE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/ActivityPubService.js

    raa45208 r837fc9c  
    246246    tag: Array.isArray(post.tags) ? post.tags.map((t) => ({ type: 'Hashtag', name: '#' + String(t).replace(/\s+/g, '') })) : [],
    247247    replies: `${id}/replies`,
     248    // NSFW → Mastodon-style content warning: sensitive (blurs media) + a summary/spoiler
     249    // (hides the whole post behind a "Gevoelige inhoud" button until the reader opens it).
     250    sensitive: !!post.nsfw,
    248251  };
     252  if (post.nsfw) note.summary = 'Gevoelige inhoud';
    249253  if (attachment.length) note.attachment = attachment;
    250254  // Playable-audio posts suppress the cover attachment (player card). Still expose
     
    771775  if (!site) return;
    772776  const recent = db.prepare(
    773     `SELECT id, slug, title, content, cover_image_url, published_at, created_at
     777    `SELECT id, slug, title, content, cover_image_url, nsfw, published_at, created_at
    774778     FROM posts WHERE site_id = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0)
    775779     ORDER BY COALESCE(published_at, created_at) DESC LIMIT 20`
Note: See TracChangeset for help on using the changeset viewer.