diff --git a/core/activitypub/settings.js b/core/activitypub/settings.js index b7f4e2bd..2b973359 100644 --- a/core/activitypub/settings.js +++ b/core/activitypub/settings.js @@ -36,18 +36,22 @@ module.exports = class ActivityPubSettings { return user.activityPubSettings; } - persistToUserProperties(user, cb = null) { + persistToUserProperties(user, cb) { return user.persistProperty( UserProps.ActivityPubSettings, JSON.stringify(this), err => { - if (!err) { - // drop from cache - delete user.activityPubSettings; - } - if (cb) { + if (err) { return cb(err); } + + // drop from cache - force re-cache + delete user.activityPubSettings; + + const { prepareLocalUserAsActor } = require('./util'); + prepareLocalUserAsActor(user, { force: false }, err => { + return cb(err); + }); } ); } diff --git a/core/activitypub/user_config.js b/core/activitypub/user_config.js index 3e207827..20ece36b 100644 --- a/core/activitypub/user_config.js +++ b/core/activitypub/user_config.js @@ -137,6 +137,7 @@ exports.getModule = class ActivityPubUserConfig extends MenuModule { `Failed saving ActivityPub settings for user "${user.username}"` ); } + return this.prevMenu(cb); }); }