Simply use "unsearchable" (and ensure it is updated for local users)

This commit is contained in:
Michael 2023-03-28 06:34:09 +00:00
parent 4c81a7ab91
commit 74222532dc
2 changed files with 13 additions and 2 deletions

View file

@ -3535,6 +3535,7 @@ class Contact
'server-blocked' => false, 'server-blocked' => false,
'failed' => false, 'failed' => false,
'deleted' => false, 'deleted' => false,
'unsearchable' => false,
'uid' => $uid 'uid' => $uid
]; ];
@ -3560,8 +3561,7 @@ class Contact
} }
$condition = DBA::mergeConditions($condition, $condition = DBA::mergeConditions($condition,
["(NOT `unsearchable` OR `nurl` IN (SELECT `nurl` FROM `owner-view` WHERE `publish` OR `net-publish`)) ["(`addr` LIKE ? OR `name` LIKE ? OR `nick` LIKE ?)", $search, $search, $search]);
AND (`addr` LIKE ? OR `name` LIKE ? OR `nick` LIKE ?)", $search, $search, $search]);
return DBA::selectToArray('account-user-view', [], $condition, $params); return DBA::selectToArray('account-user-view', [], $condition, $params);
} }

View file

@ -1315,3 +1315,14 @@ function update_1516()
return Update::SUCCESS; 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;
}