Changeset 00f669b in Klonkt
- Timestamp:
- 06/24/2026 03:27:49 PM (3 months ago)
- Branches:
- main
- Children:
- d0cab9d
- Parents:
- d988fa0
- Location:
- src
- Files:
-
- 1 added
- 4 edited
-
routes/posts.js (modified) (2 diffs)
-
services/ActivityPubService.js (modified) (2 diffs)
-
services/i18n.js (modified) (3 diffs)
-
views/pages/admin.ejs (modified) (1 diff)
-
views/pages/fedi-notifications.ejs (added)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
rd988fa0 r00f669b 86 86 'tag', 'type', 'user', 'users', 'artiesten', 'leden', 'favorieten', 'feed.xml', 'atom.xml', 'sitemap.xml', 87 87 'manifest.webmanifest', 'sw.js', 'favicon.ico', 'favicon.svg', 'assets', 88 'authorize_interaction', 'fediverse', 'tijdlijn', 88 'authorize_interaction', 'fediverse', 'tijdlijn', 'meldingen', 89 89 ]); 90 90 … … 606 606 if (site) { try { await ActivityPubService.sendInteraction(site, 'boost', (req.body.note || '').toString(), (req.body.author || '').toString()); } catch (e) { /* ignore */ } } 607 607 res.redirect('/tijdlijn?success=' + encodeURIComponent('Geboost 🔁')); 608 }); 609 610 // Notifications inbox (new followers + replies/likes/boosts on your posts). 611 router.get('/meldingen', requireSiteManager, (req, res) => { 612 const site = res.locals.site; 613 const items = site ? ActivityPubService.getNotifications(site.slug, 80) : []; 614 renderPage(req, res, 'pages/fedi-notifications', { pageTitle: 'Meldingen', bodyClass: 'on-special', items }); 608 615 }); 609 616 -
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 }; -
src/services/i18n.js
rd988fa0 r00f669b 26 26 'nav.language': 'Taal', 27 27 'nav.notifications': 'Meldingen', 28 'notif.title': 'Meldingen', 'notif.empty': 'Nog geen meldingen.', 'notif.someone': 'Iemand', 28 'notif.title': 'Meldingen', 'notif.empty': 'Nog geen meldingen.', 'notif.someone': 'Iemand', 'notif.followed': 'volgt je nu', 'notif.liked': 'likete je post', 'notif.boosted': 'boostte je post', 'notif.replied': 'reageerde op', 29 29 'notif.reply': '{actor} reageerde op je reactie', 'notif.comment': '{actor} reageerde op je post', 'notif.like': '{actor} vindt je post leuk', 30 30 'switch.agenda': 'Agenda', … … 1029 1029 'nav.language': 'Language', 1030 1030 'nav.notifications': 'Notifications', 1031 'notif.title': 'Notifications', 'notif.empty': 'No notifications yet.', 'notif.someone': 'Someone', 1031 'notif.title': 'Notifications', 'notif.empty': 'No notifications yet.', 'notif.someone': 'Someone', 'notif.followed': 'followed you', 'notif.liked': 'liked your post', 'notif.boosted': 'boosted your post', 'notif.replied': 'replied to', 1032 1032 'notif.reply': '{actor} replied to your comment', 'notif.comment': '{actor} commented on your post', 'notif.like': '{actor} liked your post', 1033 1033 'switch.agenda': 'Agenda', … … 2023 2023 'nav.language': 'Sprache', 2024 2024 'nav.notifications': 'Benachrichtigungen', 2025 'notif.title': 'Benachrichtigungen', 'notif.empty': 'Noch keine Benachrichtigungen.', 'notif.someone': 'Jemand', 2025 'notif.title': 'Benachrichtigungen', 'notif.empty': 'Noch keine Benachrichtigungen.', 'notif.someone': 'Jemand', 'notif.followed': 'folgt dir jetzt', 'notif.liked': 'gefällt dein Beitrag', 'notif.boosted': 'teilte deinen Beitrag', 'notif.replied': 'antwortete auf', 2026 2026 'notif.reply': '{actor} hat auf deinen Kommentar geantwortet', 'notif.comment': '{actor} hat deinen Beitrag kommentiert', 'notif.like': '{actor} gefällt dein Beitrag', 2027 2027 'switch.agenda': 'Termine', -
src/views/pages/admin.ejs
rd988fa0 r00f669b 58 58 <% } %> 59 59 <a href="/tijdlijn" class="btn">🌐 <%= t('tl.title') %></a> 60 <a href="/meldingen" class="btn">🔔 <%= t('notif.title') %></a> 60 61 <a href="/admin/updates" class="btn"><%= t('admin.b_updates') %></a> 61 62 <a href="/admin/handleiding" class="btn"><%= t('admin.b_help') %></a>
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)