Changeset 462a931 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 06/30/2026 01:31:49 PM (2 months ago)
- Branches:
- main
- Children:
- 8b700ad
- Parents:
- d5aa7c8
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
rd5aa7c8 r462a931 1417 1417 1418 1418 // ── Cirkel = posts from the accounts you auto-boost ("feature an artist") ── 1419 let _abCount, _cirkelPosts, _cirkel Members;1419 let _abCount, _cirkelPosts, _cirkelPostsActor, _cirkelMembers; 1420 1420 export function autoBoostCount(slug) { 1421 1421 try { if (!_abCount) _abCount = db.prepare('SELECT COUNT(*) AS n FROM ap_following WHERE slug = ? AND auto_boost = 1'); return _abCount.get(slug).n; } catch { return 0; } 1422 1422 } 1423 export function getCirkelPosts(slug, limit ) {1423 export function getCirkelPosts(slug, limit, actorUri) { 1424 1424 try { 1425 1425 // Cirkel = posts from featured (auto_boost) accounts + posts you boosted 1426 1426 // (t.boosted), mixed by date. One row per note in ap_timeline → no duplicates. 1427 // Optional actorUri → only that member's posts (the "Show this person" filter). 1428 if (actorUri) { 1429 if (!_cirkelPostsActor) _cirkelPostsActor = db.prepare(` 1430 SELECT t.id, t.author_uri, t.author_name, t.author_handle, t.author_icon, t.author_url, 1431 t.content, t.url, t.published, t.media_json, t.boosted, t.nsfw, t.cw 1432 FROM ap_timeline t 1433 LEFT JOIN ap_following f ON f.slug = t.slug AND f.actor_uri = t.author_uri 1434 WHERE t.slug = ? AND t.author_uri = ? AND (f.auto_boost = 1 OR t.boosted = 1) 1435 ORDER BY COALESCE(t.published, t.created_at) DESC, t.rowid DESC 1436 LIMIT ?`); 1437 return _cirkelPostsActor.all(slug, actorUri, limit || 60); 1438 } 1427 1439 if (!_cirkelPosts) _cirkelPosts = db.prepare(` 1428 1440 SELECT t.id, t.author_uri, t.author_name, t.author_handle, t.author_icon, t.author_url, … … 1437 1449 } 1438 1450 export function getCirkelMembers(slug) { 1439 try { if (!_cirkelMembers) _cirkelMembers = db.prepare('SELECT name, url, icon FROM ap_following WHERE slug = ? AND auto_boost = 1 ORDER BY name'); return _cirkelMembers.all(slug); } catch { return []; }1451 try { if (!_cirkelMembers) _cirkelMembers = db.prepare('SELECT actor_uri, name, url, icon FROM ap_following WHERE slug = ? AND auto_boost = 1 ORDER BY name'); return _cirkelMembers.all(slug); } catch { return []; } 1440 1452 } 1441 1453 // Mark a timeline post as boosted so it shows in the Cirkel (mixed by date).
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)