Changeset c16e0a5 in Klonkt for src/views/pages/post.ejs


Ignore:
Timestamp:
06/24/2026 11:44:23 AM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
47a0d29
Parents:
eb852c5
Message:

feat(activitypub): inbound interactions — replies, likes, boosts (Phase 2)

Inbox now stores incoming Create(reply to our note), Like and Announce (boost),
plus Undo(Like/Announce) and Delete(reply). New ap_interactions table; the post
page shows a 'From the fediverse' section (counts + replies with avatar/handle,
sanitized). Actor name/icon resolved best-effort; reply HTML sanitized.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/post.ejs

    reb852c5 rc16e0a5  
    7070      <% } %>
    7171    </aside>
     72  <% } %>
     73
     74  <!-- Fediverse interactions (inbound replies / likes / boosts via ActivityPub) -->
     75  <% if (typeof fediverse !== 'undefined' && fediverse && fediverse.total > 0) { %>
     76    <section class="post-fediverse" id="fediverse">
     77      <h2 class="fedi-heading"><%= t('fedi.heading') %></h2>
     78      <p class="fedi-stats">
     79        <span title="<%= t('fedi.likes') %>">⭐ <%= fediverse.likeCount %></span>
     80        <span title="<%= t('fedi.boosts') %>">🔁 <%= fediverse.announceCount %></span>
     81        <span title="<%= t('fedi.replies') %>">💬 <%= fediverse.replies.length %></span>
     82      </p>
     83      <% if (fediverse.replies.length) { %>
     84        <ol class="fedi-replies">
     85          <% fediverse.replies.forEach(function(r) { %>
     86            <li class="fedi-reply">
     87              <div class="comment-avatar">
     88                <% if (r.actor_icon) { %><img src="<%= r.actor_icon %>" alt="" loading="lazy">
     89                <% } else { %><span class="comment-avatar-fallback"><%= (r.actor_name || '?').charAt(0).toUpperCase() %></span><% } %>
     90              </div>
     91              <div class="comment-body">
     92                <div class="comment-meta">
     93                  <a class="comment-author" href="<%= r.actor_url %>" rel="nofollow noopener" target="_blank"><%= r.actor_name %></a>
     94                  <span class="fedi-handle"><%= r.actor_handle %></span>
     95                  <% if (r.published || r.created_at) { %><span class="comment-time"><%= formatDateTime(r.published || r.created_at) %></span><% } %>
     96                </div>
     97                <div class="comment-content"><%- r.content %></div>
     98              </div>
     99            </li>
     100          <% }); %>
     101        </ol>
     102      <% } %>
     103    </section>
    72104  <% } %>
    73105
Note: See TracChangeset for help on using the changeset viewer.