Changeset 2af2e69 in Klonkt


Ignore:
Timestamp:
06/25/2026 07:18:05 AM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
f9f3312
Parents:
5085b1d
Message:

fediverse: emit featured collection reversed (Mastodon displays pins last-first)

Mastodon shows a remote actor's featured collection in reverse of the orderedItems
order (pins ordered by processed-time desc). So we now emit pin-rank DESCENDING →
Mastodon flips it back to rank 1 first on the profile.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/activitypub.js

    r5085b1d r2af2e69  
    7777  const site = publicSite(req.params.slug);
    7878  if (!site) return res.status(404).end();
     79  // NB: Mastodon DISPLAYS the featured collection in REVERSE (pins shown
     80  // last-processed-first). So we emit it reversed (lowest pin priority first,
     81  // rank 1 last) → Mastodon flips it back to pin-rank ascending on the profile.
    7982  const posts = db.prepare(
    8083    `SELECT id, slug, title, content, cover_image_url, published_at, created_at
    8184     FROM posts WHERE site_id = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0)
    8285       AND pinned IS NOT NULL AND pinned > 0
    83      ORDER BY pinned ASC, COALESCE(published_at, created_at) DESC LIMIT 20`
     86     ORDER BY pinned DESC, COALESCE(published_at, created_at) ASC LIMIT 20`
    8487  ).all(site.id);
    8588  AP.sendAP(res, AP.buildFeatured(baseUrl(req), site, posts));
Note: See TracChangeset for help on using the changeset viewer.