mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: have options.update also trigger handle and search updates on actor assertion
This commit is contained in:
@@ -169,7 +169,7 @@ Actors.assert = async (ids, options = {}) => {
|
||||
const queries = profiles.reduce((memo, profile, idx) => {
|
||||
const { username, fullname } = current[idx];
|
||||
|
||||
if (username !== profile.username) {
|
||||
if (options.update || username !== profile.username) {
|
||||
if (uidsForCurrent[idx] !== 0) {
|
||||
memo.searchRemove.push(['ap.preferredUsername:sorted', `${username.toLowerCase()}:${profile.uid}`]);
|
||||
memo.handleRemove.push(username.toLowerCase());
|
||||
@@ -179,7 +179,7 @@ Actors.assert = async (ids, options = {}) => {
|
||||
memo.handleAdd[profile.username.toLowerCase()] = profile.uid;
|
||||
}
|
||||
|
||||
if (profile.fullname && fullname !== profile.fullname) {
|
||||
if (options.update || profile.fullname && fullname !== profile.fullname) {
|
||||
if (fullname && uidsForCurrent[idx] !== 0) {
|
||||
memo.searchRemove.push(['ap.name:sorted', `${fullname.toLowerCase()}:${profile.uid}`]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user