From c1c0e2f7d0de8a8e64f2c0d53a92c2db9588627a Mon Sep 17 00:00:00 2001 From: fenwick67 Date: Thu, 5 Sep 2019 15:41:01 -0400 Subject: [PATCH] fix issue with non-masto AP instances which may set outbox.first to the actual first page of the outbox instead of a URL --- lib/convertv2.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/convertv2.js b/lib/convertv2.js index 0581315..cd69978 100644 --- a/lib/convertv2.js +++ b/lib/convertv2.js @@ -80,9 +80,14 @@ module.exports = async function (opts) { user = await apGet(userUrl,24 * hour); isIndex = true; - var outbox = await apGet(user.outbox,24 * hour); - feedUrl = outbox.first; - feed = await apGet(feedUrl,hour/6);// 10 mins. Because the base feed URL can get new toots quickly. + var outbox = await apGet(user.outbox, 1 * hour); + + // outbox.first can be a string for a URL, or an object with stuffs in it + if (typeof outbox.first == 'object'){ + feed = outbox.first; + } else { + feed = await apGet(outbox.first, hour/6);// 10 mins. Because the base feed URL can get new toots quickly. + } }