Changeset c73ac64 in Klonkt for src/services


Ignore:
Timestamp:
06/24/2026 01:58:33 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
5b47619
Parents:
ffa53cc
Message:

fix(activitypub): own replies show the site identity to everyone (not 'You')

Outbound reply nodes carry the site name/handle/avatar so visitors see e.g.
'Joost Groot @demo@...' instead of 'You'; the owner still gets the delete action.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/services/ActivityPubService.js

    rffa53cc rc73ac64  
    250250// View-ready threaded view of a post's fediverse activity (inbound replies +
    251251// our outbound replies, nested), plus like/boost counts.
    252 export function getInteractions(postId, base) {
     252export function getInteractions(postId, base, site) {
    253253  const s = iStmts();
    254254  const rows = s.list.all(postId);
    255255  const baseClean = (base || process.env.PUBLIC_BASE_URL || '').replace(/\/+$/, '');
    256256  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;
    257263
    258264  const nodes = [];
     
    269275    nodes.push({
    270276      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: [],
    272280    });
    273281  }
Note: See TracChangeset for help on using the changeset viewer.