Use centralized function to update contact entries

This commit is contained in:
Michael 2021-09-10 18:21:19 +00:00
commit 9c14eb0c6b
20 changed files with 90 additions and 72 deletions

View file

@ -96,7 +96,7 @@ function pubsub_init(App $a)
}
if (!empty($hub_mode)) {
DBA::update('contact', ['subhub' => $subscribe], ['id' => $contact['id']]);
Contact::update(['subhub' => $subscribe], ['id' => $contact['id']]);
Logger::log($hub_mode . ' success for contact ' . $contact_id . '.');
}
hub_return(true, $hub_challenge);

View file

@ -149,7 +149,7 @@ function unfollow_process(string $url)
Contact::remove($contact['id']);
$return_path = $base_return_path;
} else {
DBA::update('contact', ['rel' => Contact::FOLLOWER], ['id' => $contact['id']]);
Contact::update(['rel' => Contact::FOLLOWER], ['id' => $contact['id']]);
$return_path = $base_return_path . '/' . $contact['id'];
}