fix: do not retrieve remote outbox count when asserting actor

This change means that a remote user's post count is only the number
of posts they have stored locally. This is easier to reconcile with
the profile UI since showing the artificial number could cause issues
if the local instance contains fewer or no posts by that user.

fixes #12646
This commit is contained in:
Julian Lam
2024-06-21 16:46:33 -04:00
parent 0573e8f3de
commit 16f8f536da
2 changed files with 1 additions and 11 deletions

View File

@@ -101,15 +101,6 @@ Actors.assert = async (ids, options = {}) => {
// winston.verbose(`[activitypub/actor.assert] Unable to retrieve follower counts for ${actor.id}`);
}
// Post count
try {
const outbox = actor.outbox ? await activitypub.get('uid', 0, actor.outbox) : { totalItems: 0 };
actor.postcount = outbox.totalItems;
} catch (e) {
// no action required
// winston.verbose(`[activitypub/actor.assert] Unable to retrieve post counts for ${actor.id}`);
}
// Save url for backreference
const url = Array.isArray(actor.url) ? actor.url.shift() : actor.url;
if (url && url !== actor.id) {

View File

@@ -39,7 +39,7 @@ Mocks.profile = async (actors) => {
let {
url, preferredUsername, published, icon, image,
name, summary, followers, followerCount, followingCount,
postcount, inbox, endpoints,
inbox, endpoints,
} = actor;
preferredUsername = preferredUsername || slugify(name);
@@ -68,7 +68,6 @@ Mocks.profile = async (actors) => {
'cover:url': !image || typeof image === 'string' ? image : image.url,
'cover:position': '50% 50%',
aboutme: summary,
postcount,
followerCount,
followingCount,