Changeset 3d7312a in Klonkt for src/views/pages


Ignore:
Timestamp:
06/24/2026 12:44:21 PM (3 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
594cc50
Parents:
82079ad
Message:

feat(activitypub): remote interaction — reply to any fediverse post from your own server

Standard 'reply from your own server' flow: every post page has a 'Reply via the
fediverse' button that bounces the visitor to their home server's
/authorize_interaction?uri=. Klonkt implements that endpoint: the site owner
composes a reply that's resolved (resolveRemoteNote) + federated back to the
remote post as the site actor. Works Klonkt<->Klonkt and with Mastodon.

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

Location:
src/views/pages
Files:
1 added
1 edited

Legend:

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

    r82079ad r3d7312a  
    135135    </section>
    136136  <% } %>
     137
     138  <!-- Reply via the fediverse (remote interaction: bounces to the visitor's own server) -->
     139  <% var _postAbsUrl = (typeof ogOrigin !== 'undefined' && ogOrigin ? ogOrigin : '') + (typeof _base !== 'undefined' && _base ? _base : '') + '/' + post.slug; %>
     140  <div class="post-fediverse-cta">
     141    <button type="button" class="btn fedi-remote-reply-btn"
     142      onclick="(function(){var d=prompt(<%- JSON.stringify(t('fedi.remote_prompt')) %>);if(!d)return;d=d.trim().replace(/^@?[^@\s]*@/,'').replace(/^https?:\/\//i,'').replace(/\/.*$/,'').trim();if(d)location.href='https://'+d+'/authorize_interaction?uri='+encodeURIComponent(<%- JSON.stringify(_postAbsUrl) %>);})()">
     143      🐘 <%= t('fedi.remote_reply') %>
     144    </button>
     145  </div>
    137146
    138147  <!-- Comments -->
Note: See TracChangeset for help on using the changeset viewer.