mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
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:
@@ -101,15 +101,6 @@ Actors.assert = async (ids, options = {}) => {
|
|||||||
// winston.verbose(`[activitypub/actor.assert] Unable to retrieve follower counts for ${actor.id}`);
|
// 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
|
// Save url for backreference
|
||||||
const url = Array.isArray(actor.url) ? actor.url.shift() : actor.url;
|
const url = Array.isArray(actor.url) ? actor.url.shift() : actor.url;
|
||||||
if (url && url !== actor.id) {
|
if (url && url !== actor.id) {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Mocks.profile = async (actors) => {
|
|||||||
let {
|
let {
|
||||||
url, preferredUsername, published, icon, image,
|
url, preferredUsername, published, icon, image,
|
||||||
name, summary, followers, followerCount, followingCount,
|
name, summary, followers, followerCount, followingCount,
|
||||||
postcount, inbox, endpoints,
|
inbox, endpoints,
|
||||||
} = actor;
|
} = actor;
|
||||||
preferredUsername = preferredUsername || slugify(name);
|
preferredUsername = preferredUsername || slugify(name);
|
||||||
|
|
||||||
@@ -68,7 +68,6 @@ Mocks.profile = async (actors) => {
|
|||||||
'cover:url': !image || typeof image === 'string' ? image : image.url,
|
'cover:url': !image || typeof image === 'string' ? image : image.url,
|
||||||
'cover:position': '50% 50%',
|
'cover:position': '50% 50%',
|
||||||
aboutme: summary,
|
aboutme: summary,
|
||||||
postcount,
|
|
||||||
followerCount,
|
followerCount,
|
||||||
followingCount,
|
followingCount,
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user