}
if (ActivityPub::isRequest()) {
- goaway(str_replace('display/', 'object/', $a->query_string));
+ goaway(str_replace('display/', 'objects/', $a->query_string));
}
if ($item["id"] != $item["parent"]) {
$guid = System::createUUID();
}
- return self::getApp()->get_baseurl() . '/object/' . $guid;
+ return self::getApp()->get_baseurl() . '/objects/' . $guid;
}
/**
+++ /dev/null
-<?php
-/**
- * @file src/Module/Object.php
- */
-namespace Friendica\Module;
-
-use Friendica\BaseModule;
-use Friendica\Protocol\ActivityPub;
-use Friendica\Core\System;
-use Friendica\Model\Item;
-use Friendica\Database\DBA;
-
-/**
- * ActivityPub Object
- */
-class Object extends BaseModule
-{
- public static function rawContent()
- {
- $a = self::getApp();
-
- if (empty($a->argv[1])) {
- System::httpExit(404);
- }
-
- if (!ActivityPub::isRequest()) {
- goaway(str_replace('object/', 'display/', $a->query_string));
- }
-
- $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'wall' => true, 'private' => false]);
- if (!DBA::isResult($item)) {
- System::httpExit(404);
- }
-
- $data = ActivityPub::createObjectFromItemID($item['id']);
-
- header('Content-Type: application/activity+json');
- echo json_encode($data);
- exit();
- }
-}
--- /dev/null
+<?php
+/**
+ * @file src/Module/Object.php
+ */
+namespace Friendica\Module;
+
+use Friendica\BaseModule;
+use Friendica\Protocol\ActivityPub;
+use Friendica\Core\System;
+use Friendica\Model\Item;
+use Friendica\Database\DBA;
+
+/**
+ * ActivityPub Object
+ */
+class Object extends BaseModule
+{
+ public static function rawContent()
+ {
+ $a = self::getApp();
+
+ if (empty($a->argv[1])) {
+ System::httpExit(404);
+ }
+
+ if (!ActivityPub::isRequest()) {
+ goaway(str_replace('objects/', 'display/', $a->query_string));
+ }
+
+ $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'wall' => true, 'private' => false]);
+ if (!DBA::isResult($item)) {
+ System::httpExit(404);
+ }
+
+ $data = ActivityPub::createObjectFromItemID($item['id']);
+
+ header('Content-Type: application/activity+json');
+ echo json_encode($data);
+ exit();
+ }
+}
} elseif (DBA::isResult($conversation) && !empty($conversation['conversation-uri'])) {
$context_uri = $conversation['conversation-uri'];
} else {
- $context_uri = str_replace('/object/', '/context/', $item['parent-uri']);
+ $context_uri = str_replace('/objects/', '/context/', $item['parent-uri']);
}
return $context_uri;
}
unset($parts['path']);
$host_url = Network::unparseURL($parts);
- return $host_url . '/object/' . $guid;
+ return $host_url . '/objects/' . $guid;
}
return "";
}
if (intval($item["parent"]) > 0) {
- $conversation_href = $conversation_uri = str_replace('/object/', '/context/', $item['parent-uri']);
+ $conversation_href = $conversation_uri = str_replace('/objects/', '/context/', $item['parent-uri']);
if (isset($parent_item)) {
$conversation = DBA::selectFirst('conversation', ['conversation-uri', 'conversation-href'], ['item-uri' => $parent_item]);