mirror of
https://github.com/svemagie/indiekit-endpoint-activitypub.git
synced 2026-04-02 15:44:58 +02:00
fix: support plain-object collections in resolveAuthor (Mastodon Client API like/reblog)
resolveAuthor() called collections.get("ap_timeline") assuming a Map, but
the Mastodon Client API passes collections as a plain object
(req.app.locals.mastodonCollections). This caused "collection.get is not a
function" on every favourite/reblog action from Mastodon clients (Phanpy,
Elk, etc.). Now checks typeof collections.get before deciding which access
pattern to use.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -92,8 +92,8 @@ export async function resolveAuthor(
|
||||
|
||||
// Strategy 2: Use author URL from timeline or notifications
|
||||
if (collections) {
|
||||
const ap_timeline = collections.get("ap_timeline");
|
||||
const ap_notifications = collections.get("ap_notifications");
|
||||
const ap_timeline = typeof collections.get === "function" ? collections.get("ap_timeline") : collections.ap_timeline;
|
||||
const ap_notifications = typeof collections.get === "function" ? collections.get("ap_notifications") : collections.ap_notifications;
|
||||
|
||||
// Search timeline by both uid (canonical) and url (display)
|
||||
let authorUrl = null;
|
||||
|
||||
Reference in New Issue
Block a user