Changeset c73ac64 in Klonkt for src/services/ActivityPubService.js
- Timestamp:
- 06/24/2026 01:58:33 PM (3 months ago)
- Branches:
- main
- Children:
- 5b47619
- Parents:
- ffa53cc
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
rffa53cc rc73ac64 250 250 // View-ready threaded view of a post's fediverse activity (inbound replies + 251 251 // our outbound replies, nested), plus like/boost counts. 252 export function getInteractions(postId, base ) {252 export function getInteractions(postId, base, site) { 253 253 const s = iStmts(); 254 254 const rows = s.list.all(postId); 255 255 const baseClean = (base || process.env.PUBLIC_BASE_URL || '').replace(/\/+$/, ''); 256 256 const postNoteId = baseClean ? `${baseClean}/ap/notes/${postId}` : null; 257 // Our own (outbound) replies show the SITE identity for everyone (not "You"). 258 let host = ''; try { host = new URL(baseClean).host; } catch { /* ignore */ } 259 const siteName = (site && (site.title || site.slug)) || ''; 260 const siteHandle = (site && site.slug && host) ? `@${site.slug}@${host}` : ''; 261 const siteUrl = baseClean ? `${baseClean}/` : ''; 262 const siteIcon = (site && site.profile_photo) || null; 257 263 258 264 const nodes = []; … … 269 275 nodes.push({ 270 276 noteId: baseClean ? `${baseClean}/ap/notes/${o.id}` : o.id, parent: o.in_reply_to || null, 271 mine: true, outboxId: o.id, content: o.content, created_at: o.created_at, children: [], 277 mine: true, outboxId: o.id, content: o.content, created_at: o.created_at, 278 actor_name: siteName, actor_handle: siteHandle, actor_url: siteUrl, actor_icon: siteIcon, 279 children: [], 272 280 }); 273 281 }
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)