Centzralized functionality to update and publish profile changes

This commit is contained in:
Michael
2021-06-15 11:12:44 +00:00
parent c9ec2e21b3
commit 0ab24510ef
8 changed files with 125 additions and 69 deletions

View File

@@ -53,6 +53,7 @@ use Friendica\Model\ItemURI;
use Friendica\Model\Notification;
use Friendica\Model\Photo;
use Friendica\Model\Post;
use Friendica\Model\Profile;
use Friendica\Model\Storage;
use Friendica\Worker\Delivery;
@@ -98,8 +99,9 @@ function update_1298()
DBA::update('profile', [$translateKey => $key], ['id' => $data['id']]);
Logger::notice('Updated contact', ['action' => 'update', 'contact' => $data['id'], "$translateKey" => $key,
'was' => $data[$translateKey]]);
Worker::add(PRIORITY_LOW, 'ProfileUpdate', $data['id']);
Contact::updateSelfFromUserID($data['id']);
Profile::publishUpdate($data['id']);
$success++;
}
}
@@ -153,7 +155,9 @@ function update_1323()
{
$users = DBA::select('user', ['uid']);
while ($user = DBA::fetch($users)) {
Contact::updateSelfFromUserID($user['uid']);
if (Contact::updateSelfFromUserID($user['uid'])) {
Profile::publishUpdate($user['uid']);
}
}
DBA::close($users);