Changeset 837fc9c in Klonkt for src/routes/activitypub.js


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/routes/activitypub.js

    raa45208 r837fc9c  
    6767  if (!site) return res.status(404).end();
    6868  const posts = db.prepare(
    69     `SELECT id, slug, title, content, cover_image_url, published_at, created_at
     69    `SELECT id, slug, title, content, cover_image_url, nsfw, published_at, created_at
    7070     FROM posts WHERE site_id = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0)
    7171     ORDER BY COALESCE(published_at, created_at) DESC LIMIT 20`
     
    9090  // rank 1 last) → Mastodon flips it back to pin-rank ascending on the profile.
    9191  const posts = db.prepare(
    92     `SELECT id, slug, title, content, cover_image_url, published_at, created_at
     92    `SELECT id, slug, title, content, cover_image_url, nsfw, published_at, created_at
    9393     FROM posts WHERE site_id = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0)
    9494       AND pinned IS NOT NULL AND pinned > 0
Note: See TracChangeset for help on using the changeset viewer.