Changeset b7d4458 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 06/27/2026 08:10:43 AM (2 months ago)
- Branches:
- main
- Children:
- c21197a
- Parents:
- 92f6976
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r92f6976 rb7d4458 250 250 sensitive: !!post.nsfw, 251 251 }; 252 if (post.nsfw) note.summary = 'Gevoelige inhoud';252 if (post.nsfw) note.summary = post.content_warning || 'Gevoelige inhoud'; 253 253 if (attachment.length) note.attachment = attachment; 254 254 // Playable-audio posts suppress the cover attachment (player card). Still expose … … 708 708 // the timeline). 709 709 for (const s of subs) { 710 tlStmts().ins.run(o.id, s.slug, actorUri, ai.name, ai.handle, ai.icon, ai.url, html, o.url || null, o.published || null, media );710 tlStmts().ins.run(o.id, s.slug, actorUri, ai.name, ai.handle, ai.icon, ai.url, html, o.url || null, o.published || null, media, o.sensitive ? 1 : 0, o.summary || null); 711 711 } 712 712 console.log('[AP] timeline +', actorUri, 'x' + subs.length); … … 775 775 if (!site) return; 776 776 const recent = db.prepare( 777 `SELECT id, slug, title, content, cover_image_url, nsfw, published_at, created_at777 `SELECT id, slug, title, content, cover_image_url, nsfw, content_warning, published_at, created_at 778 778 FROM posts WHERE site_id = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0) 779 779 ORDER BY COALESCE(published_at, created_at) DESC LIMIT 20` … … 1011 1011 url: note.url || url, 1012 1012 content: HtmlSanitizerService.sanitize(rawHtml), // full, sanitized 1013 sensitive: !!note.sensitive, // remote CW → blur in the Cirkel 1014 cw: note.summary || '', 1013 1015 images, 1014 1016 threadInboxes, // every ancestor author's inbox … … 1083 1085 function tlStmts() { 1084 1086 if (!_insTl) { 1085 _insTl = db.prepare('INSERT OR IGNORE INTO ap_timeline (id, slug, author_uri, author_name, author_handle, author_icon, author_url, content, url, published, media_json, created_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP)');1087 _insTl = db.prepare('INSERT OR IGNORE INTO ap_timeline (id, slug, author_uri, author_name, author_handle, author_icon, author_url, content, url, published, media_json, nsfw, cw, created_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,CURRENT_TIMESTAMP)'); 1086 1088 _listTl = db.prepare('SELECT * FROM ap_timeline WHERE slug = ? ORDER BY COALESCE(published, created_at) DESC LIMIT ?'); 1087 1089 _delTl = db.prepare('DELETE FROM ap_timeline WHERE id = ?'); … … 1102 1104 if (!_cirkelPosts) _cirkelPosts = db.prepare(` 1103 1105 SELECT t.id, t.author_uri, t.author_name, t.author_handle, t.author_icon, t.author_url, 1104 t.content, t.url, t.published, t.media_json, t.boosted 1106 t.content, t.url, t.published, t.media_json, t.boosted, t.nsfw, t.cw 1105 1107 FROM ap_timeline t 1106 1108 LEFT JOIN ap_following f ON f.slug = t.slug AND f.actor_uri = t.author_uri … … 1142 1144 tlStmts().ins.run(id, slug, note.actor_uri || '', note.actor_name || '', note.actor_handle || '', 1143 1145 note.actor_icon || '', note.actor_url || '', note.content || '', note.url || null, 1144 new Date().toISOString(), media );1146 new Date().toISOString(), media, note.sensitive ? 1 : 0, note.cw || null); 1145 1147 } catch { /* ignore */ } 1146 1148 markBoosted(slug, id);
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)