Merge pull request #4136 from Rudloff/feature/update_profile_api

Cleaner way to get user URL in api_account_update_profile
This commit is contained in:
Hypolite Petovan 2017-12-26 17:13:58 -06:00 committed by GitHub
commit b39e06ed23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4497,11 +4497,10 @@ function api_account_update_profile($type)
dba::update('contact', ['about' => $_POST['description']], ['id' => $api_user['id']]);
}
Worker::add(PRIORITY_LOW, 'ProfileUpdate', api_user());
Worker::add(PRIORITY_LOW, 'ProfileUpdate', $local_user);
// Update global directory in background
$url = $_SESSION['my_url'];
if ($url && strlen(Config::get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $url);
if ($api_user['url'] && strlen(Config::get('system', 'directory'))) {
Worker::add(PRIORITY_LOW, "Directory", $api_user['url']);
}
return api_account_verify_credentials($type);