mirror of
https://github.com/friendica/friendica
synced 2025-04-26 21:10:16 +00:00
Cache the AP delivery process
This commit is contained in:
parent
be7bd10678
commit
51dbffd396
3 changed files with 34 additions and 3 deletions
|
@ -11,6 +11,14 @@ use Friendica\Util\HTTPSignature;
|
|||
|
||||
class APDelivery extends BaseObject
|
||||
{
|
||||
/**
|
||||
* @brief Delivers ActivityPub messages
|
||||
*
|
||||
* @param string $cmd
|
||||
* @param integer $item_id
|
||||
* @param string $inbox
|
||||
* @param integer $uid
|
||||
*/
|
||||
public static function execute($cmd, $item_id, $inbox, $uid)
|
||||
{
|
||||
logger('Invoked: ' . $cmd . ': ' . $item_id . ' to ' . $inbox, LOGGER_DEBUG);
|
||||
|
@ -23,12 +31,10 @@ class APDelivery extends BaseObject
|
|||
} elseif ($cmd == Delivery::PROFILEUPDATE) {
|
||||
ActivityPub\Transmitter::sendProfileUpdate($uid, $inbox);
|
||||
} else {
|
||||
$data = ActivityPub\Transmitter::createActivityFromItem($item_id);
|
||||
$data = ActivityPub\Transmitter::createCachedActivityFromItem($item_id);
|
||||
if (!empty($data)) {
|
||||
HTTPSignature::transmit($data, $inbox, $uid);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue