source: Klonkt/src/views/partials/fedi-node.ejs@ dc8e9bd

main
Last change on this file since dc8e9bd was c73ac64, checked in by Robin Genis <roboburr@…>, 3 months ago

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@…>

  • Property mode set to 100644
File size: 2.2 KB
Line 
1<%# Renders one fediverse thread node (n). Expects: n, t, canManageSite, _base, siteAvatar, formatDateTime %>
2<div class="comment-avatar">
3 <% if (n.actor_icon) { %><img src="<%= n.actor_icon %>" alt="" loading="lazy">
4 <% } else { %><span><%= (n.actor_name || '?').charAt(0).toUpperCase() %></span><% } %>
5</div>
6<div class="comment-body">
7 <div class="comment-meta">
8 <% if (n.actor_url) { %><a class="comment-author" href="<%= n.actor_url %>" rel="nofollow noopener" target="_blank"><%= n.actor_name %></a>
9 <% } else { %><span class="comment-author"><%= n.actor_name %></span><% } %>
10 <% if (n.actor_handle) { %><span class="fedi-handle"><%= n.actor_handle %></span><% } %>
11 <% if (n.created_at) { %><span class="comment-time"><%= formatDateTime(n.created_at) %></span><% } %>
12 </div>
13 <div class="comment-content"><%- n.content %></div>
14 <div class="comment-actions">
15 <% if (n.mine && typeof canManageSite !== 'undefined' && canManageSite && n.outboxId) { %>
16 <form method="post" action="<%= _base %>/fediverse/<%= n.outboxId %>/delete" onsubmit="return confirm('<%= t('fedi.delete_confirm') %>')">
17 <button type="submit" class="comment-delete-btn"><%= t('comments.delete') %></button>
18 </form>
19 <% } else if (!n.mine && n.noteId) { %>
20 <button type="button" class="comment-reply-btn fedi-remote-reply-btn" data-fedi-uri="<%= n.noteId %>" data-fedi-prompt="<%= t('fedi.remote_prompt') %>">
21 <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="9 17 4 12 9 7"/><path d="M20 18v-2a4 4 0 0 0-4-4H4"/></svg>
22 <%= t('fedi.remote_reply_short') %>
23 </button>
24 <% } %>
25 </div>
26 <% if (n.children && n.children.length) { %>
27 <ol class="comment-replies">
28 <% n.children.forEach(function(c){ %>
29 <li class="comment comment-reply"><%- include('../partials/fedi-node', { n: c, t: t, canManageSite: (typeof canManageSite !== 'undefined' ? canManageSite : false), _base: _base, siteAvatar: (typeof siteAvatar !== 'undefined' ? siteAvatar : null), formatDateTime: formatDateTime }) %></li>
30 <% }); %>
31 </ol>
32 <% } %>
33</div>
Note: See TracBrowser for help on using the repository browser.