mirror of
https://github.com/friendica/friendica
synced 2025-05-14 06:24:10 +02:00
Avoid return type exeption in HTTPSignature->post
- Prefer passing the owner record array instead of just the uid - +4/-7 calls to User::getOwnerDataById
This commit is contained in:
parent
3fcc45a720
commit
6e31b8d6a5
7 changed files with 101 additions and 95 deletions
|
@ -24,6 +24,7 @@ namespace Friendica\Worker;
|
|||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Model\Post;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Protocol\ActivityPub;
|
||||
class APDelivery
|
||||
{
|
||||
|
@ -69,7 +70,14 @@ class APDelivery
|
|||
$drop = false;
|
||||
$uri_ids = $result['uri_ids'];
|
||||
} else {
|
||||
$result = ActivityPub\Delivery::deliverToInbox($cmd, $item_id, $inbox, $uid, $receivers, $uri_id);
|
||||
$owner = User::getOwnerDataById($uid);
|
||||
if (!$owner) {
|
||||
Post\Delivery::remove($uri_id, $inbox);
|
||||
Post\Delivery::incrementFailed($uri_id, $inbox);
|
||||
return;
|
||||
}
|
||||
|
||||
$result = ActivityPub\Delivery::deliverToInbox($cmd, $item_id, $inbox, $owner, $receivers, $uri_id);
|
||||
$success = $result['success'];
|
||||
$drop = $result['drop'];
|
||||
$uri_ids = [$uri_id];
|
||||
|
|
|
@ -24,6 +24,8 @@ namespace Friendica\Worker\Contact;
|
|||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\Worker;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Network\HTTPException;
|
||||
|
||||
class RevokeFollow
|
||||
{
|
||||
|
@ -43,8 +45,12 @@ class RevokeFollow
|
|||
return;
|
||||
}
|
||||
|
||||
$result = Protocol::revokeFollow($contact, $uid);
|
||||
if ($result === false) {
|
||||
$owner = User::getOwnerDataById($uid, false);
|
||||
if (empty($owner)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Protocol::revokeFollow($contact, $owner)) {
|
||||
Worker::defer();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue