From ebb84f5e434370596c303cde86c4ebc96fa3cdc5 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 24 Jan 2019 18:54:45 +0000 Subject: [PATCH] DFRN comments are now stored as comments again --- src/Protocol/DFRN.php | 12 ++++++------ src/Protocol/OStatus.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 52790d46dd..e6524de965 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2512,8 +2512,8 @@ class DFRN } $notice_info = $xpath->query("statusnet:notice_info", $entry); - if ($notice_info && ($notice_info->length > 0) && !empty($notice_info->item)) { - foreach ($notice_info->item[0]->attributes as $attributes) { + if ($notice_info && ($notice_info->length > 0)) { + foreach ($notice_info->item(0)->attributes as $attributes) { if ($attributes->name == "source") { $item["app"] = strip_tags($attributes->textContent); } @@ -2588,8 +2588,8 @@ class DFRN $item['conversation-uri'] = XML::getFirstNodeValue($xpath, 'ostatus:conversation/text()', $entry); $conv = $xpath->query('ostatus:conversation', $entry); - if (!empty($conv->item[0])) { - foreach ($conv->item[0]->attributes as $attributes) { + if (is_object($conv->item(0))) { + foreach ($conv->item(0)->attributes as $attributes) { if ($attributes->name == "ref") { $item['conversation-uri'] = $attributes->textContent; } @@ -2603,8 +2603,8 @@ class DFRN $item["parent-uri"] = $item["uri"]; $inreplyto = $xpath->query("thr:in-reply-to", $entry); - if (!empty($inreplyto->item[0])) { - foreach ($inreplyto->item[0]->attributes as $attributes) { + if (is_object($inreplyto->item(0))) { + foreach ($inreplyto->item(0)->attributes as $attributes) { if ($attributes->name == "ref") { $item["parent-uri"] = $attributes->textContent; } diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index 45071f82e2..38105e452a 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -72,7 +72,7 @@ class OStatus } $author["author-id"] = Contact::getIdForURL($author["author-link"]); - $author["contact-id"] = $contact["id"]; + $author['contact-id'] = defaults($contact, 'id', $author['author-id']); $contact = []; -- 2.39.5