]> git.mxchange.org Git - friendica.git/blob - src/Worker/APDelivery.php
22b8c8f0ffd865560ab8fb827f091a3369950399
[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, $uid)
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                 } elseif ($cmd == Delivery::REMOVAL) {
22                         ActivityPub::transmitProfileDeletion($uid, $inbox);
23                 } elseif ($cmd == Delivery::PROFILEUPDATE) {
24                         ActivityPub::transmitProfileUpdate($uid, $inbox);
25                 } else {
26                         $data = ActivityPub::createActivityFromItem($item_id);
27                         if (!empty($data)) {
28                                 HTTPSignature::transmit($data, $inbox, $uid);
29                         }
30                 }
31
32                 return;
33         }
34 }