]> git.mxchange.org Git - friendica.git/blob - src/Worker/APDelivery.php
Merge pull request #5841 from JonnyTischbein/issue_profile_edit_sexual_marital
[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         /**
15          * @brief Delivers ActivityPub messages
16          *
17          * @param string $cmd
18          * @param integer $item_id
19          * @param string $inbox
20          * @param integer $uid
21          */
22         public static function execute($cmd, $item_id, $inbox, $uid)
23         {
24                 logger('Invoked: ' . $cmd . ': ' . $item_id . ' to ' . $inbox, LOGGER_DEBUG);
25
26                 if ($cmd == Delivery::MAIL) {
27                 } elseif ($cmd == Delivery::SUGGESTION) {
28                 } elseif ($cmd == Delivery::RELOCATION) {
29                 } elseif ($cmd == Delivery::REMOVAL) {
30                         ActivityPub\Transmitter::sendProfileDeletion($uid, $inbox);
31                 } elseif ($cmd == Delivery::PROFILEUPDATE) {
32                         ActivityPub\Transmitter::sendProfileUpdate($uid, $inbox);
33                 } else {
34                         $data = ActivityPub\Transmitter::createCachedActivityFromItem($item_id);
35                         if (!empty($data)) {
36                                 HTTPSignature::transmit($data, $inbox, $uid);
37                         }
38                 }
39         }
40 }