Changeset d8e3ff7 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 06/30/2026 01:38:13 PM (2 months ago)
- Branches:
- main
- Children:
- 5924bbf
- Parents:
- 8b700ad
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r8b700ad rd8e3ff7 1420 1420 1421 1421 // ── Cirkel = posts from the accounts you auto-boost ("feature an artist") ── 1422 let _abCount, _cirkelPosts, _cirkel PostsActor, _cirkelMembers;1422 let _abCount, _cirkelPosts, _cirkelMembers; 1423 1423 export function autoBoostCount(slug) { 1424 1424 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; } 1425 1425 } 1426 export function getCirkelPosts(slug, limit , actorUri) {1426 export function getCirkelPosts(slug, limit) { 1427 1427 try { 1428 1428 // Cirkel = posts from featured (auto_boost) accounts + posts you boosted 1429 1429 // (t.boosted), mixed by date. One row per note in ap_timeline → no duplicates. 1430 // Optional actorUri → only that member's posts (the "Show this person" filter).1431 if (actorUri) {1432 if (!_cirkelPostsActor) _cirkelPostsActor = db.prepare(`1433 SELECT t.id, t.author_uri, t.author_name, t.author_handle, t.author_icon, t.author_url,1434 t.content, t.url, t.published, t.media_json, t.boosted, t.nsfw, t.cw1435 FROM ap_timeline t1436 LEFT JOIN ap_following f ON f.slug = t.slug AND f.actor_uri = t.author_uri1437 WHERE t.slug = ? AND t.author_uri = ? AND (f.auto_boost = 1 OR t.boosted = 1)1438 ORDER BY COALESCE(t.published, t.created_at) DESC, t.rowid DESC1439 LIMIT ?`);1440 return _cirkelPostsActor.all(slug, actorUri, limit || 60);1441 }1442 1430 if (!_cirkelPosts) _cirkelPosts = db.prepare(` 1443 1431 SELECT t.id, t.author_uri, t.author_name, t.author_handle, t.author_icon, t.author_url, … … 1452 1440 } 1453 1441 export function getCirkelMembers(slug) { 1454 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 []; }1442 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 []; } 1455 1443 } 1456 1444 // 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)