Changeset 5045c30 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 06/26/2026 12:00:18 PM (2 months ago)
- Branches:
- main
- Children:
- 3384e95
- Parents:
- 484adf8
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r484adf8 r5045c30 1056 1056 export function getCirkelPosts(slug, limit) { 1057 1057 try { 1058 // Cirkel = posts from featured (auto_boost) accounts + posts you boosted 1059 // (t.boosted), mixed by date. One row per note in ap_timeline → no duplicates. 1058 1060 if (!_cirkelPosts) _cirkelPosts = db.prepare(` 1059 1061 SELECT t.id, t.author_uri, t.author_name, t.author_handle, t.author_icon, t.author_url, 1060 1062 t.content, t.url, t.published, t.media_json 1061 1063 FROM ap_timeline t 1062 JOIN ap_following f ON f.slug = t.slug AND f.actor_uri = t.author_uri AND f.auto_boost = 11063 WHERE t.slug = ? 1064 LEFT JOIN ap_following f ON f.slug = t.slug AND f.actor_uri = t.author_uri 1065 WHERE t.slug = ? AND (f.auto_boost = 1 OR t.boosted = 1) 1064 1066 ORDER BY COALESCE(t.published, t.created_at) DESC, t.rowid DESC 1065 1067 LIMIT ?`); … … 1069 1071 export function getCirkelMembers(slug) { 1070 1072 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 []; } 1073 } 1074 // Mark a timeline post as boosted so it shows in the Cirkel (mixed by date). 1075 let _markBoost, _boostedCount; 1076 export function markBoosted(slug, noteId) { 1077 try { if (!_markBoost) _markBoost = db.prepare('UPDATE ap_timeline SET boosted = 1 WHERE slug = ? AND id = ?'); _markBoost.run(slug, noteId); } catch { /* ignore */ } 1078 } 1079 export function boostedCount(slug) { 1080 try { if (!_boostedCount) _boostedCount = db.prepare('SELECT COUNT(*) AS n FROM ap_timeline WHERE slug = ? AND boosted = 1'); return _boostedCount.get(slug).n; } catch { return 0; } 1071 1081 } 1072 1082 … … 1346 1356 listOutbox, deliverOutboxDelete, 1347 1357 webfingerResolve, followActor, resolveRemoteActor, unfollowActor, listFollowing, setAutoBoost, getTimeline, sendInteraction, 1348 autoBoostCount, getCirkelPosts, getCirkelMembers, autoMigrateCircles, selfHealTimeline, boostLatestN,1358 autoBoostCount, boostedCount, markBoosted, getCirkelPosts, getCirkelMembers, autoMigrateCircles, selfHealTimeline, boostLatestN, 1349 1359 getNotifications, listBlocks, isBlockedAny, blockTarget, unblock, 1350 1360 deliverWithRetry, enqueueDelivery, processDeliveryQueue, startDeliveryWorker,
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)