Ensure AP setup for user if not already at toggle time
This commit is contained in:
parent
94842afd7e
commit
35c97f7035
|
@ -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);
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -137,6 +137,7 @@ exports.getModule = class ActivityPubUserConfig extends MenuModule {
|
|||
`Failed saving ActivityPub settings for user "${user.username}"`
|
||||
);
|
||||
}
|
||||
|
||||
return this.prevMenu(cb);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue