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;
|
return user.activityPubSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
persistToUserProperties(user, cb = null) {
|
persistToUserProperties(user, cb) {
|
||||||
return user.persistProperty(
|
return user.persistProperty(
|
||||||
UserProps.ActivityPubSettings,
|
UserProps.ActivityPubSettings,
|
||||||
JSON.stringify(this),
|
JSON.stringify(this),
|
||||||
err => {
|
err => {
|
||||||
if (!err) {
|
if (err) {
|
||||||
// drop from cache
|
|
||||||
delete user.activityPubSettings;
|
|
||||||
}
|
|
||||||
if (cb) {
|
|
||||||
return cb(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}"`
|
`Failed saving ActivityPub settings for user "${user.username}"`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.prevMenu(cb);
|
return this.prevMenu(cb);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue