sforkowany z mirror/friendica
Force a directory update if previously published
rodzic
1ced04e54c
commit
3796e13142
|
@ -725,6 +725,7 @@ class Contact
|
|||
'thumb' => DI::baseUrl() . '/photo/avatar/' . $uid .'.' . $file_suffix];
|
||||
DBA::update('profile', $fields, ['uid' => $uid]);
|
||||
}
|
||||
|
||||
return $update;
|
||||
}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ class Profile
|
|||
}
|
||||
|
||||
if ($update) {
|
||||
self::publishUpdate($uid);
|
||||
self::publishUpdate($uid, ($old_owner['net-publish'] != $owner['net-publish']));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -132,14 +132,16 @@ class Profile
|
|||
/**
|
||||
* Publish a changed profile
|
||||
* @param int $uid
|
||||
* @param bool $force Force publishing to the directory
|
||||
*/
|
||||
public static function publishUpdate(int $uid)
|
||||
public static function publishUpdate(int $uid, bool $force = false)
|
||||
{
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
if (empty($owner)) {
|
||||
return;
|
||||
}
|
||||
if ($owner['net-publish']) {
|
||||
|
||||
if ($owner['net-publish'] || $force) {
|
||||
// Update global directory in background
|
||||
if (Search::getGlobalDirectory()) {
|
||||
Worker::add(PRIORITY_LOW, 'Directory', $owner['url']);
|
||||
|
|
Ładowanie…
Reference in New Issue