Node.js based forum software built for the modern web
fix: have options.update also trigger handle and search updates on actor assertion
Julian Lam050acb4f8578
diff --git a/src/activitypub/actors.js b/src/activitypub/actors.jsindex 0d5edfa584..fb0cc94de4 100644--- a/src/activitypub/actors.js+++ b/src/activitypub/actors.js@@ -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}`]);}