Changeset 7d19465 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 07/17/2026 02:27:52 AM (8 weeks ago)
- Branches:
- main
- Children:
- f1a23b8
- Parents:
- 92a2c46
- git-author:
- Robin <roboburr@…> (07/17/2026 02:27:34 AM)
- git-committer:
- Robin <roboburr@…> (07/17/2026 02:27:52 AM)
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r92a2c46 r7d19465 1828 1828 cw: note.summary || '', 1829 1829 images, 1830 // Full typed media (incl. video/mp4) for the timeline cache. `images` above is 1831 // image-only for the interact page preview; a boosted video-only post (Loops) 1832 // lost its media entirely because upsertBoostedNote only saw `images`. 1833 media: mediaFromNote(note), 1830 1834 threadInboxes, // every ancestor author's inbox 1831 1835 localPostId: localTgt ? localTgt.post_id : '', // our post this belongs to (if any) … … 2014 2018 if (!slug || !note || !note.object_uri) return; 2015 2019 const id = note.object_uri; 2016 const media = JSON.stringify((note.images || []).map((u) => ({ url: u, type: 'image/jpeg' }))); 2020 // Prefer the full typed media (incl. video/mp4 — a Loops boost is video-only and 2021 // rendered a bare text tile); fall back to the image-only list for older callers. 2022 const media = (note.media && note.media !== '[]') 2023 ? note.media 2024 : JSON.stringify((note.images || []).map((u) => ({ url: u, type: 'image/jpeg' }))); 2017 2025 try { 2018 2026 const r = tlStmts().ins.run(id, slug, note.actor_uri || '', note.actor_name || '', note.actor_handle || '', … … 2023 2031 // resolved note. Without this a row cached without its cover (or with 2024 2032 // stale content) stayed stale forever — even boosting again didn't heal it. 2025 db.prepare('UPDATE ap_timeline SET content = ?, media_json = ?, nsfw = ?, cw = ?, url = COALESCE(?, url) WHERE slug = ? AND id = ?') 2026 .run(note.content || '', media, note.sensitive ? 1 : 0, note.cw || null, note.url || null, slug, id); 2033 // Keep the CACHED media when the resolve yielded none: an empty re-resolve 2034 // used to clobber a good media_json (the followed copy had the video, the 2035 // boost wiped it to []). 2036 db.prepare(`UPDATE ap_timeline SET content = ?, media_json = CASE WHEN ? = '[]' THEN media_json ELSE ? END, 2037 nsfw = ?, cw = ?, url = COALESCE(?, url) WHERE slug = ? AND id = ?`) 2038 .run(note.content || '', media, media, note.sensitive ? 1 : 0, note.cw || null, note.url || null, slug, id); 2027 2039 } 2028 2040 } catch { /* ignore */ }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)