Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
668 B

  1. <?php
  2. /**
  3. * @file src/Worker/APDelivery.php
  4. */
  5. namespace Friendica\Worker;
  6. use Friendica\BaseObject;
  7. use Friendica\Protocol\ActivityPub;
  8. use Friendica\Model\Item;
  9. class APDelivery extends BaseObject
  10. {
  11. public static function execute($cmd, $item_id, $inbox)
  12. {
  13. logger('Invoked: ' . $cmd . ': ' . $item_id . ' to ' . $inbox, LOGGER_DEBUG);
  14. if ($cmd == Delivery::MAIL) {
  15. } elseif ($cmd == Delivery::SUGGESTION) {
  16. } elseif ($cmd == Delivery::RELOCATION) {
  17. } else {
  18. $item = Item::selectFirst(['uid'], ['id' => $item_id]);
  19. $data = ActivityPub::createActivityFromItem($item_id);
  20. ActivityPub::transmit($data, $inbox, $item['uid']);
  21. }
  22. return;
  23. }
  24. }