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,
'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);
}

View File

@ -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;
}