From 54aef550c5c6b7dbe2e772ed1dee8462c2de4d98 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 17 Nov 2020 17:52:30 -0500 Subject: [PATCH 1/6] Remove superfluous mentions of parent-uri in Protocol\Diaspora - Address part of https://github.com/friendica/friendica/issues/9252#issuecomment-729171051 --- src/Protocol/Diaspora.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 9e9f1a574..7ab41eb52 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -1565,7 +1565,6 @@ class Diaspora $datarray["gravity"] = GRAVITY_COMMENT; $datarray['thr-parent'] = $thr_parent ?: $toplevel_parent_item['uri']; - $datarray['parent-uri'] = $toplevel_parent_item['uri']; $datarray["object-type"] = Activity\ObjectType::COMMENT; @@ -1963,7 +1962,6 @@ class Diaspora $datarray["verb"] = Activity::FOLLOW; $datarray["gravity"] = GRAVITY_ACTIVITY; $datarray['thr-parent'] = $toplevel_parent_item['uri']; - $datarray['parent-uri'] = $toplevel_parent_item['parent-uri']; $datarray["object-type"] = Activity\ObjectType::NOTE; @@ -2356,7 +2354,6 @@ class Diaspora $datarray['guid'] = $parent['guid'] . '-' . $guid; $datarray['uri'] = self::getUriFromGuid($author, $datarray['guid']); $datarray['thr-parent'] = $parent['uri']; - $datarray['parent-uri'] = $parent['parent-uri']; $datarray['verb'] = $datarray['body'] = Activity::ANNOUNCE; $datarray['gravity'] = GRAVITY_ACTIVITY; From 283b70928d9df3a9f4b2f457bdefdadc8586a32d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 17 Nov 2020 17:53:03 -0500 Subject: [PATCH 2/6] Remove top-level parent check from Protocol\OStatus - It's done in Item::insert instead - Address part of https://github.com/friendica/friendica/issues/9252#issuecomment-729171051 --- src/Protocol/OStatus.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 9d9e10f7a..b8724acc7 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -521,12 +521,6 @@ class OStatus Logger::log("Item with uri ".self::$itemlist[0]['uri']." will be imported since the thread contains posts or shares.", Logger::DEBUG); } } - } else { - // But we will only import complete threads - $valid = Item::exists(['uid' => $importer["uid"], 'uri' => self::$itemlist[0]['parent-uri']]); - if ($valid) { - Logger::log("Item with uri ".self::$itemlist[0]["uri"]." belongs to parent ".self::$itemlist[0]['thr-parent']." of user ".$importer["uid"].". It will be imported.", Logger::DEBUG); - } } if ($valid) { From 93380b8471164a8ed5d1d46e94d53bf37fe87cee Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 17 Nov 2020 17:57:37 -0500 Subject: [PATCH 3/6] Suppress notice while logging in Model\Contact - Address https://github.com/friendica/friendica/issues/9252#issuecomment-716042132 --- src/Model/Contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 656506d84..80a5d93cb 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1113,7 +1113,7 @@ class Contact $contact = self::selectFirst(['id'], ['nurl' => $urls, 'uid' => $uid]); if (!empty($contact['id'])) { $contact_id = $contact['id']; - Logger::info('Fetched id by url', ['cid' => $contact_id, 'uid' => $uid, 'url' => $url, 'probed_url' => $data['url'], 'alias' => $data['alias'], 'addr' => $data['addr']]); + Logger::info('Fetched id by url', ['cid' => $contact_id, 'uid' => $uid, 'url' => $url, 'data' => $data]); } } From ccad67c68fde4dc2529509b85a2d5714628a0855 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 17 Nov 2020 17:59:39 -0500 Subject: [PATCH 4/6] Use correct contact key in Protocol\ActivityPub\Transmitter - Address https://github.com/friendica/friendica/issues/9252#issuecomment-719866843 --- src/Protocol/ActivityPub/Transmitter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 43a4384d4..531a23a69 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -719,7 +719,7 @@ class Transmitter continue; } - if ($isforum && ($contact['dfrn'] == Protocol::DFRN)) { + if ($isforum && ($contact['network'] == Protocol::DFRN)) { continue; } From 260b9e7bd3b8e663f77d05970df6cfb76e3ca430 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 17 Nov 2020 18:01:03 -0500 Subject: [PATCH 5/6] Improve expectation for not modified check in theme/vier/style - Address https://github.com/friendica/friendica/issues/9252#issuecomment-721994406 --- view/theme/vier/style.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/vier/style.php b/view/theme/vier/style.php index ac5cd08ef..8cd0d7a32 100644 --- a/view/theme/vier/style.php +++ b/view/theme/vier/style.php @@ -61,7 +61,7 @@ header('Cache-Control: public'); header('ETag: "'.$etag.'"'); header('Last-Modified: '.$modified); -if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) { +if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && isset($_SERVER['HTTP_IF_NONE_MATCH'])) { $cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])); $cached_etag = str_replace(['"', "-gzip"], ['', ''], stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])); From 096cb19d1205952142b3ed85d3760e6af4364d49 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 17 Nov 2020 18:06:16 -0500 Subject: [PATCH 6/6] Suppress notice when causer-id exists but not causer-link in Model\Item::isAllowedByUser - Address https://github.com/friendica/friendica/issues/9252#issuecomment-723440980 --- src/Model/Item.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 0fcb445e0..9890c8a99 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -3980,12 +3980,12 @@ class Item // The causer is set during a thread completion, for example because of a reshare. It countains the responsible actor. if (!empty($item['causer-id']) && Contact\User::isBlocked($item['causer-id'], $user_id)) { - Logger::notice('Causer is blocked by user', ['causer-link' => $item['causer-link'], 'uid' => $user_id, 'item-uri' => $item['uri']]); + Logger::notice('Causer is blocked by user', ['causer-link' => $item['causer-link'] ?? $item['causer-id'], 'uid' => $user_id, 'item-uri' => $item['uri']]); return false; } if (!empty($item['causer-id']) && ($item['gravity'] === GRAVITY_PARENT) && Contact\User::isIgnored($item['causer-id'], $user_id)) { - Logger::notice('Causer is ignored by user', ['causer-link' => $item['causer-link'], 'uid' => $user_id, 'item-uri' => $item['uri']]); + Logger::notice('Causer is ignored by user', ['causer-link' => $item['causer-link'] ?? $item['causer-id'], 'uid' => $user_id, 'item-uri' => $item['uri']]); return false; }