Changeset 2c22bb5 in Klonkt for src/services
- Timestamp:
- 06/26/2026 08:53:42 AM (2 months ago)
- Branches:
- main
- Children:
- 46f3dd6
- Parents:
- 49b1b39
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r49b1b39 r2c22bb5 1032 1032 export function getTimeline(slug, limit) { return tlStmts().list.all(slug, limit || 50); } 1033 1033 1034 // ── Cirkel = posts from the accounts you auto-boost ("feature an artist") ── 1035 let _abCount, _cirkelPosts, _cirkelMembers; 1036 export function autoBoostCount(slug) { 1037 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; } 1038 } 1039 export function getCirkelPosts(slug, limit) { 1040 try { 1041 if (!_cirkelPosts) _cirkelPosts = db.prepare(` 1042 SELECT t.id, t.author_uri, t.author_name, t.author_handle, t.author_icon, t.author_url, 1043 t.content, t.url, t.published, t.media_json 1044 FROM ap_timeline t 1045 JOIN ap_following f ON f.slug = t.slug AND f.actor_uri = t.author_uri AND f.auto_boost = 1 1046 WHERE t.slug = ? 1047 ORDER BY COALESCE(t.published, t.created_at) DESC, t.rowid DESC 1048 LIMIT ?`); 1049 return _cirkelPosts.all(slug, limit || 60); 1050 } catch { return []; } 1051 } 1052 export function getCirkelMembers(slug) { 1053 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 []; } 1054 } 1055 1034 1056 // Follow a fediverse account by @handle (WebFinger → actor → signed Follow). 1035 1057 export async function followActor(site, handle, autoBoost = false) { … … 1190 1212 listOutbox, deliverOutboxDelete, 1191 1213 webfingerResolve, followActor, resolveRemoteActor, unfollowActor, listFollowing, setAutoBoost, getTimeline, sendInteraction, 1214 autoBoostCount, getCirkelPosts, getCirkelMembers, 1192 1215 getNotifications, listBlocks, isBlockedAny, blockTarget, unblock, 1193 1216 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)