mirror of
https://github.com/friendica/friendica
synced 2025-04-26 21:10:16 +00:00
New delivery module for ap
This commit is contained in:
parent
91d1b4de5d
commit
f772ece86f
7 changed files with 183 additions and 89 deletions
28
src/Worker/APDelivery.php
Normal file
28
src/Worker/APDelivery.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* @file src/Worker/APDelivery.php
|
||||
*/
|
||||
namespace Friendica\Worker;
|
||||
|
||||
use Friendica\BaseObject;
|
||||
use Friendica\Protocol\ActivityPub;
|
||||
use Friendica\Model\Item;
|
||||
|
||||
class APDelivery extends BaseObject
|
||||
{
|
||||
public static function execute($cmd, $item_id, $inbox)
|
||||
{
|
||||
logger('Invoked: ' . $cmd . ': ' . $item_id . ' to ' . $inbox, LOGGER_DEBUG);
|
||||
|
||||
if ($cmd == Delivery::MAIL) {
|
||||
} elseif ($cmd == Delivery::SUGGESTION) {
|
||||
} elseif ($cmd == Delivery::RELOCATION) {
|
||||
} else {
|
||||
$item = Item::selectFirst(['uid'], ['id' => $item_id]);
|
||||
$data = ActivityPub::createActivityFromItem($item_id);
|
||||
ActivityPub::transmit($data, $inbox, $item['uid']);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue