From 74222532dcece0f53aa4fa8ad38a22b7cad58c4c Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 28 Mar 2023 06:34:09 +0000 Subject: [PATCH] Simply use "unsearchable" (and ensure it is updated for local users) --- src/Model/Contact.php | 4 ++-- update.php | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 54689fb624..d93c5f8367 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -3535,6 +3535,7 @@ class Contact 'server-blocked' => false, 'failed' => false, 'deleted' => false, + 'unsearchable' => false, 'uid' => $uid ]; @@ -3560,8 +3561,7 @@ class Contact } $condition = DBA::mergeConditions($condition, - ["(NOT `unsearchable` OR `nurl` IN (SELECT `nurl` FROM `owner-view` WHERE `publish` OR `net-publish`)) - AND (`addr` LIKE ? OR `name` LIKE ? OR `nick` LIKE ?)", $search, $search, $search]); + ["(`addr` LIKE ? OR `name` LIKE ? OR `nick` LIKE ?)", $search, $search, $search]); return DBA::selectToArray('account-user-view', [], $condition, $params); } diff --git a/update.php b/update.php index 8dcd1b71dd..3cd0a45a7b 100644 --- a/update.php +++ b/update.php @@ -1315,3 +1315,14 @@ function update_1516() return Update::SUCCESS; } + +function update_1518() +{ + $users = DBA::select('user', ['uid']); + while ($user = DBA::fetch($users)) { + Contact::updateSelfFromUserID($user['uid']); + } + DBA::close($users); + + return Update::SUCCESS; +} -- 2.39.5