]> git.mxchange.org Git - friendica.git/blob - src/Worker/APDelivery.php
Improvements to signature check, private posts do work now again
[friendica.git] / src / Worker / APDelivery.php
1 <?php
2 /**
3  * @file src/Worker/APDelivery.php
4  */
5 namespace Friendica\Worker;
6
7 use Friendica\BaseObject;
8 use Friendica\Protocol\ActivityPub;
9 use Friendica\Model\Item;
10 use Friendica\Util\HTTPSignature;
11
12 class APDelivery extends BaseObject
13 {
14         public static function execute($cmd, $item_id, $inbox)
15         {
16                 logger('Invoked: ' . $cmd . ': ' . $item_id . ' to ' . $inbox, LOGGER_DEBUG);
17
18                 if ($cmd == Delivery::MAIL) {
19                 } elseif ($cmd == Delivery::SUGGESTION) {
20                 } elseif ($cmd == Delivery::RELOCATION) {
21                 } else {
22                         $item = Item::selectFirst(['uid'], ['id' => $item_id]);
23                         $data = ActivityPub::createActivityFromItem($item_id);
24                         HTTPSignature::transmit($data, $inbox, $item['uid']);
25                 }
26
27                 return;
28         }
29 }