From 0c3a5c815e7067aa587ac8f0bb8e32bb5892082e Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Mon, 9 Nov 2020 11:13:18 -0500 Subject: [PATCH] Remove obsolete references to item.parent-uri --- include/api.php | 1 - mod/photos.php | 3 --- src/Model/Event.php | 1 - src/Model/Item.php | 7 +++---- src/Module/Contact/Poke.php | 1 - src/Worker/OnePoll.php | 1 + 6 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/api.php b/include/api.php index 87ce982b0..5969ccd5f 100644 --- a/include/api.php +++ b/include/api.php @@ -4766,7 +4766,6 @@ function post_photo_item($hash, $allow_cid, $deny_cid, $allow_gid, $deny_gid, $f $arr['guid'] = System::createUUID(); $arr['uid'] = intval(api_user()); $arr['uri'] = $uri; - $arr['parent-uri'] = $uri; $arr['type'] = 'photo'; $arr['wall'] = 1; $arr['resource-id'] = $hash; diff --git a/mod/photos.php b/mod/photos.php index bba12aace..e94a3ed8d 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -395,7 +395,6 @@ function photos_post(App $a) $arr['guid'] = System::createUUID(); $arr['uid'] = $page_owner_uid; $arr['uri'] = $uri; - $arr['parent-uri'] = $uri; $arr['post-type'] = Item::PT_IMAGE; $arr['wall'] = 1; $arr['resource-id'] = $photo['resource-id']; @@ -560,7 +559,6 @@ function photos_post(App $a) $arr['guid'] = System::createUUID(); $arr['uid'] = $page_owner_uid; $arr['uri'] = $uri; - $arr['parent-uri'] = $uri; $arr['wall'] = 1; $arr['contact-id'] = $owner_record['id']; $arr['owner-name'] = $owner_record['name']; @@ -791,7 +789,6 @@ function photos_post(App $a) $arr['guid'] = System::createUUID(); $arr['uid'] = $page_owner_uid; $arr['uri'] = $uri; - $arr['parent-uri'] = $uri; $arr['type'] = 'photo'; $arr['wall'] = 1; $arr['resource-id'] = $resource_id; diff --git a/src/Model/Event.php b/src/Model/Event.php index 6f8ed123c..5139abc43 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -347,7 +347,6 @@ class Event $item_arr['uid'] = $event['uid']; $item_arr['contact-id'] = $event['cid']; $item_arr['uri'] = $event['uri']; - $item_arr['parent-uri'] = $event['uri']; $item_arr['guid'] = $event['guid']; $item_arr['plink'] = $arr['plink'] ?? ''; $item_arr['post-type'] = Item::PT_EVENT; diff --git a/src/Model/Item.php b/src/Model/Item.php index c03722372..e67b86234 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1633,7 +1633,6 @@ class Item $item['coord'] = trim($item['coord'] ?? ''); $item['visible'] = (isset($item['visible']) ? intval($item['visible']) : 1); $item['deleted'] = 0; - $item['parent-uri'] = trim(($item['parent-uri'] ?? '') ?: $item['uri']); $item['post-type'] = ($item['post-type'] ?? '') ?: self::PT_ARTICLE; $item['verb'] = trim($item['verb'] ?? ''); $item['object-type'] = trim($item['object-type'] ?? ''); @@ -2858,14 +2857,15 @@ class Item unset($datarray["plink"]); $datarray["uri"] = self::newURI($contact['uid'], $datarray["guid"]); $datarray["uri-id"] = ItemURI::getIdByURI($datarray["uri"]); - $datarray["parent-uri"] = $datarray["uri"]; - $datarray["thr-parent"] = $datarray["uri"]; $datarray["extid"] = Protocol::DFRN; $urlpart = parse_url($datarray2['author-link']); $datarray["app"] = $urlpart["host"]; if (!empty($old_uri_id)) { Post\Media::copy($old_uri_id, $datarray["uri-id"]); } + + unset($datarray["parent-uri"]); + unset($datarray["thr-parent"]); } else { $datarray['private'] = self::PUBLIC; } @@ -3297,7 +3297,6 @@ class Item 'network' => Protocol::DFRN, 'gravity' => GRAVITY_ACTIVITY, 'parent' => $item['id'], - 'parent-uri' => $item['uri'], 'thr-parent' => $item['uri'], 'owner-id' => $author_id, 'author-id' => $author_id, diff --git a/src/Module/Contact/Poke.php b/src/Module/Contact/Poke.php index 9f2ae7bde..d9fab36c0 100644 --- a/src/Module/Contact/Poke.php +++ b/src/Module/Contact/Poke.php @@ -67,7 +67,6 @@ class Poke extends BaseModule $arr['guid'] = System::createUUID(); $arr['uid'] = $uid; $arr['uri'] = $uri; - $arr['parent-uri'] = $uri; $arr['wall'] = 1; $arr['contact-id'] = $actor['id']; $arr['owner-name'] = $actor['name']; diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index 93dff93ae..8f1e94580 100644 --- a/src/Worker/OnePoll.php +++ b/src/Worker/OnePoll.php @@ -625,6 +625,7 @@ class OnePoll if (empty($datarray['parent-uri'])) { $datarray['parent-uri'] = $datarray['uri']; } + unset($datarray['parent-uri']); $headers = imap_headerinfo($mbox, $meta->msgno);