fix: use human-readable URLs for reply-to links (v2.7.1)

Reply links were using the AP internal object ID (e.g.
/ap/users/{id}/statuses/{id}) which returns 404 on Mastodon for
browsers. Now uses the human-readable URL (/@username/{id}) for
replyTo params in item cards and notification cards.

- Store url field on reply/mention notifications (inbox-listeners)
- Prefer item.url over item.uid for compose replyTo links
- Falls back to uid for existing notifications without url field

Confab-Link: http://localhost:8080/sessions/d116ad5b-ef8a-424e-9ebe-76c06bef1df6
This commit is contained in:
Ricardo
2026-03-05 08:24:08 +01:00
parent 7611dba40f
commit 2083741535
4 changed files with 6 additions and 4 deletions
+2
View File
@@ -431,6 +431,7 @@ export function registerInboxListeners(inboxChain, options) {
await addNotification(collections, {
uid: object.id?.href || `reply:${actorUrl}:${inReplyTo}`,
url: object.url?.href || object.id?.href || "",
type: "reply",
actorUrl: actorInfo.url,
actorName: actorInfo.name,
@@ -462,6 +463,7 @@ export function registerInboxListeners(inboxChain, options) {
await addNotification(collections, {
uid: object.id?.href || `mention:${actorUrl}:${object.id?.href}`,
url: object.url?.href || object.id?.href || "",
type: "mention",
actorUrl: actorInfo.url,
actorName: actorInfo.name,
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@rmdes/indiekit-endpoint-activitypub",
"version": "2.7.0",
"version": "2.7.1",
"description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
"keywords": [
"indiekit",
+1 -1
View File
@@ -230,7 +230,7 @@
if (this.error) setTimeout(() => this.error = '', 3000);
}
}">
<a href="{{ mountPath }}/admin/reader/compose?replyTo={{ itemUid | urlencode }}"
<a href="{{ mountPath }}/admin/reader/compose?replyTo={{ (itemUrl or itemUid) | urlencode }}"
class="ap-card__action ap-card__action--reply"
title="{{ __('activitypub.reader.actions.reply') }}">
↩ {{ __("activitypub.reader.actions.reply") }}{% if replyCount != null %}<span class="ap-card__count">{{ replyCount }}</span>{% endif %}
+2 -2
View File
@@ -56,10 +56,10 @@
{% if item.type == "reply" or item.type == "mention" %}
<div class="ap-notification__actions">
<a href="{{ mountPath }}/admin/reader/compose?replyTo={{ item.uid | urlencode }}" class="ap-notification__reply-btn" title="{{ __('activitypub.reader.actions.reply') }}">
<a href="{{ mountPath }}/admin/reader/compose?replyTo={{ (item.url or item.uid) | urlencode }}" class="ap-notification__reply-btn" title="{{ __('activitypub.reader.actions.reply') }}">
↩ {{ __("activitypub.reader.actions.reply") }}
</a>
<a href="{{ mountPath }}/admin/reader/post?url={{ item.uid | urlencode }}" class="ap-notification__thread-btn" title="{{ __('activitypub.reader.post.title') }}">
<a href="{{ mountPath }}/admin/reader/post?url={{ (item.url or item.uid) | urlencode }}" class="ap-notification__thread-btn" title="{{ __('activitypub.reader.post.title') }}">
💬 {{ __("activitypub.notifications.viewThread") }}
</a>
</div>