Changeset 00f669b in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 06/24/2026 03:27:49 PM (3 months ago)
- Branches:
- main
- Children:
- d0cab9d
- Parents:
- d988fa0
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
rd988fa0 r00f669b 737 737 } 738 738 739 // Notifications inbox: new followers + replies/likes/boosts on this site's posts. 740 export function getNotifications(slug, limit) { 741 const out = []; 742 try { 743 for (const f of db.prepare('SELECT actor_uri, created_at FROM ap_followers WHERE slug = ? ORDER BY created_at DESC LIMIT 50').all(slug)) { 744 out.push({ type: 'follow', handle: deriveHandle(f.actor_uri), url: f.actor_uri, created_at: f.created_at }); 745 } 746 } catch { /* ignore */ } 747 try { 748 const rows = db.prepare(` 749 SELECT i.kind, i.actor_name, i.actor_handle, i.actor_url, i.content, i.created_at, 750 p.slug AS post_slug, p.title AS post_title 751 FROM ap_interactions i LEFT JOIN posts p ON p.id = i.post_id 752 WHERE p.site_id = (SELECT id FROM sites WHERE slug = ?) 753 ORDER BY i.created_at DESC LIMIT 80 754 `).all(slug); 755 for (const r of rows) out.push({ 756 type: r.kind, name: r.actor_name, handle: r.actor_handle, url: r.actor_url, 757 content: r.content, post_slug: r.post_slug, post_title: r.post_title, created_at: r.created_at, 758 }); 759 } catch { /* ignore */ } 760 out.sort((a, b) => new Date(b.created_at) - new Date(a.created_at)); 761 return out.slice(0, limit || 60); 762 } 763 739 764 export default { 740 765 getOrCreateKeys, apWants, sendAP, actorId, noteId, … … 744 769 listOutbox, deliverOutboxDelete, 745 770 webfingerResolve, followActor, unfollowActor, listFollowing, getTimeline, sendInteraction, 771 getNotifications, 746 772 };
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)