fix issue with non-masto AP instances which may set outbox.first to the actual first page of the outbox instead of a URL

This commit is contained in:
fenwick67 2019-09-05 15:41:01 -04:00
parent 0c9f0c790f
commit c1c0e2f7d0

View file

@ -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.
}
}