1
1
Fork 0

Merge pull request #5812 from annando/develop

Issue 5811: "objects" instead of "object"
This commit is contained in:
Hypolite Petovan 2018-10-02 22:11:28 -04:00 committed by GitHub
commit 1f7cb530c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 9 deletions

View file

@ -78,7 +78,7 @@ function display_init(App $a)
} }
if (ActivityPub::isRequest()) { if (ActivityPub::isRequest()) {
goaway(str_replace('display/', 'object/', $a->query_string)); goaway(str_replace('display/', 'objects/', $a->query_string));
} }
if ($item["id"] != $item["parent"]) { if ($item["id"] != $item["parent"]) {

View file

@ -2361,7 +2361,7 @@ class Item extends BaseObject
$guid = System::createUUID(); $guid = System::createUUID();
} }
return self::getApp()->get_baseurl() . '/object/' . $guid; return self::getApp()->get_baseurl() . '/objects/' . $guid;
} }
/** /**

View file

@ -1,6 +1,6 @@
<?php <?php
/** /**
* @file src/Module/Object.php * @file src/Module/Objects.php
*/ */
namespace Friendica\Module; namespace Friendica\Module;
@ -11,9 +11,9 @@ use Friendica\Model\Item;
use Friendica\Database\DBA; use Friendica\Database\DBA;
/** /**
* ActivityPub Object * ActivityPub Objects
*/ */
class Object extends BaseModule class Objects extends BaseModule
{ {
public static function rawContent() public static function rawContent()
{ {
@ -24,7 +24,7 @@ class Object extends BaseModule
} }
if (!ActivityPub::isRequest()) { if (!ActivityPub::isRequest()) {
goaway(str_replace('object/', 'display/', $a->query_string)); goaway(str_replace('objects/', 'display/', $a->query_string));
} }
$item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'wall' => true, 'private' => false]); $item = Item::selectFirst(['id'], ['guid' => $a->argv[1], 'wall' => true, 'private' => false]);

View file

@ -663,7 +663,7 @@ class ActivityPub
} elseif (DBA::isResult($conversation) && !empty($conversation['conversation-uri'])) { } elseif (DBA::isResult($conversation) && !empty($conversation['conversation-uri'])) {
$context_uri = $conversation['conversation-uri']; $context_uri = $conversation['conversation-uri'];
} else { } else {
$context_uri = str_replace('/object/', '/context/', $item['parent-uri']); $context_uri = str_replace('/objects/', '/context/', $item['parent-uri']);
} }
return $context_uri; return $context_uri;
} }

View file

@ -1598,7 +1598,7 @@ class Diaspora
unset($parts['path']); unset($parts['path']);
$host_url = Network::unparseURL($parts); $host_url = Network::unparseURL($parts);
return $host_url . '/object/' . $guid; return $host_url . '/objects/' . $guid;
} }
return ""; return "";

View file

@ -2004,7 +2004,7 @@ class OStatus
} }
if (intval($item["parent"]) > 0) { 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)) { if (isset($parent_item)) {
$conversation = DBA::selectFirst('conversation', ['conversation-uri', 'conversation-href'], ['item-uri' => $parent_item]); $conversation = DBA::selectFirst('conversation', ['conversation-uri', 'conversation-href'], ['item-uri' => $parent_item]);