Changeset 1485933 in Klonkt for src/routes
- Timestamp:
- 07/20/2026 07:35:55 AM (7 weeks ago)
- Branches:
- main
- Children:
- 520e477
- Parents:
- 7b04d3b
- git-author:
- Robin <roboburr@…> (07/20/2026 07:18:02 AM)
- git-committer:
- Robin <roboburr@…> (07/20/2026 07:35:55 AM)
- File:
-
- 1 edited
-
src/routes/posts.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
r7b04d3b r1485933 777 777 router.get('/messages', requireSiteManager, (req, res) => { 778 778 const site = res.locals.site; 779 const items = site ? ActivityPubService.getMessages(site.slug, 80) : []; 779 const append = req.query.append === '1'; 780 const offset = Math.max(0, parseInt(req.query.offset, 10) || 0); 781 const page = site ? ActivityPubService.getMessages(site.slug, FEED_PAGE + 1, offset) : []; 782 const hasMore = page.length > FEED_PAGE; 783 const items = page.slice(0, FEED_PAGE); 780 784 // Read the watermark BEFORE marking seen → unread dots on items newer than last visit. 781 785 const seenAt = site ? ActivityPubService.notificationsSeenAt(site.slug) : 0; 782 if (site && !isViewer(req.session.user)) ActivityPubService.markNotificationsSeen(site.slug); 786 // Only stamp "seen" on the first page load (not on Load-more appends). 787 if (site && !append && !isViewer(req.session.user)) ActivityPubService.markNotificationsSeen(site.slug); 788 const moreBase = res.locals.siteUrlBase || ''; 789 if (append) { 790 return renderPage(req, res, 'partials/messages-append', { items, seen: seenAt, hasMore, nextOffset: offset + FEED_PAGE, moreBase }); 791 } 783 792 renderPage(req, res, 'pages/messages', { 784 793 pageTitleKey: 'msg.title', bodyClass: 'on-special', items, seenAt, 794 hasMore, nextOffset: offset + FEED_PAGE, moreBase, 785 795 success: req.query.success || null, error: req.query.error || null, 786 796 });
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)