Changeset 3155d8c in Klonkt for src/services
- Timestamp:
- 10/29/2026 05:50:58 PM (3 hours ago)
- Branches:
- main
- Parents:
- e4119c2
- Location:
- src/services
- Files:
-
- 2 edited
-
ActivityPubService.js (modified) (3 diffs)
-
ap-timeline.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
re4119c2 r3155d8c 55 55 getTimeline, replyRowsByUri, timelineRowsByIds, getReplyMessages, 56 56 feedCursor, feedChangesSince, waitForFeedChange, 57 conversationHeads, conversationHistory, inboxPage, messageRowsByUri,57 conversationHeads, conversationHistory, inboxPage, inboxRandomPage, messageRowsByUri, 58 58 readMarkers, markRead, unreadPerConversation, getDirectMessages, 59 59 isoStamp, timelineAttachments, extractEmojiTags, gateAttachments, … … 64 64 getTimeline, replyRowsByUri, timelineRowsByIds, getReplyMessages, 65 65 feedCursor, feedChangesSince, waitForFeedChange, 66 conversationHeads, conversationHistory, inboxPage, messageRowsByUri,66 conversationHeads, conversationHistory, inboxPage, inboxRandomPage, messageRowsByUri, 67 67 readMarkers, markRead, unreadPerConversation, getDirectMessages, 68 68 isoStamp, timelineAttachments, extractEmojiTags, gateAttachments, … … 4395 4395 getInteractions, getInteractionById, setInteractionBoosted, setInteractionLiked, buildReplyNote, getOutboxNote, getSentNotes, deliverReply, resolveRemoteNote, noteAudience, mayReadNote, 4396 4396 listOutbox, deliverOutboxDelete, deliverOutboxUpdate, deliverDirectNote, 4397 webfingerResolve, followActor, resolveRemoteActor, unfollowActor, handleMoveInbox, moveAccount, listFollowing, setAutoBoost, backfillFromOutbox, getTimeline, timelineRowsByIds, contentWarning, getDirectMessages, readMarkers, markRead, unreadPerConversation, messageRowsByUri, replyRowsByUri, conversationHeads, conversationHistory, inboxPage, i soStamp, timelineAttachments, timelineEmojis, timelineObjectLinks, timelineQuote, timelineEmbed, applyQuoteProps, deliverToActor, sendInteraction, voteOnPoll, voteOnRemotePoll,4397 webfingerResolve, followActor, resolveRemoteActor, unfollowActor, handleMoveInbox, moveAccount, listFollowing, setAutoBoost, backfillFromOutbox, getTimeline, timelineRowsByIds, contentWarning, getDirectMessages, readMarkers, markRead, unreadPerConversation, messageRowsByUri, replyRowsByUri, conversationHeads, conversationHistory, inboxPage, inboxRandomPage, isoStamp, timelineAttachments, timelineEmojis, timelineObjectLinks, timelineQuote, timelineEmbed, applyQuoteProps, deliverToActor, sendInteraction, voteOnPoll, voteOnRemotePoll, 4398 4398 acceptGatedFollow, rejectGatedFollow, isWardGuardian, outboxAudience, sendFollowDecision, 4399 4399 gateOutgoingFollow, performApprovedFollow, recordGuardianEvent, listGuardianEvents, GUARDIAN_EVENT_KEEP, -
src/services/ap-timeline.js
re4119c2 r3155d8c 402 402 } 403 403 404 /** 405 * Een pagina vanaf een willekeurige post in je geschiedenis (shaer-ewrt). 406 * 407 * Het anker is een TIJDLIJNRIJ, geen willekeurige rij uit de unie: de app 408 * toont posts in het raster, en een greep die op een stapel berichten landt 409 * laat niets zien. Vanaf daar is het een gewone pagina over alle poten, dus 410 * `start` is een echte cursor en `next` loopt gewoon door. 411 * 412 * `rnd` is er voor de toetsen. 413 */ 414 export function inboxRandomPage(slug, { limit = 60, rnd = Math.random } = {}) { 415 try { 416 const { n } = db.prepare('SELECT COUNT(*) AS n FROM ap_timeline WHERE slug = ?').get(slug); 417 const k = n ? Math.min(Math.floor(rnd() * n), n - 1) : 0; 418 if (k === 0) return { ...inboxPage(slug, { limit }), start: null }; 419 // De rij er net boven: de pagina begint direct daaronder, met het anker 420 // als eerste post. Zelfde stempel en volgorde als de unie. 421 const boven = db.prepare(` 422 SELECT id AS ref, ${STEMPEL('COALESCE(published, created_at)')} AS stamp 423 FROM ap_timeline WHERE slug = ? 424 ORDER BY stamp DESC, ref DESC LIMIT 1 OFFSET ?`).get(slug, k - 1); 425 const start = cursorOf(boven); 426 return { ...inboxPage(slug, { before: start, limit }), start }; 427 } catch { return { rows: [], more: false, oldest: null, start: null }; } 428 } 429 404 430 // De kolommen die een bericht tot kaart maken. Een constante, want de 405 431 // gesprekslezing haalt dezelfde rows op: twee lijsten die uiteenlopen leveren
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)