X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=src%2FProtocol%2FOStatus.php;h=bf3a6ef9d597021227c21bd57b6096dbd592c842;hb=b36e0e58b71ecb6d92aa2fd38341c2be64cc5858;hp=dc30b596fcc2b54098e3dc7e3db1a4dacff18ced;hpb=09de4a5b47439542d5e73d5452e1d30da26c3ae6;p=friendica.git diff --git a/src/Protocol/OStatus.php b/src/Protocol/OStatus.php index dc30b596fc..bf3a6ef9d5 100644 --- a/src/Protocol/OStatus.php +++ b/src/Protocol/OStatus.php @@ -1,7 +1,24 @@ . + * */ + namespace Friendica\Protocol; use DOMDocument; @@ -230,7 +247,7 @@ class OStatus $gcid = GContact::update($contact); GContact::link($gcid, $contact["uid"], $contact["id"]); - } elseif ($contact["network"] != Protocol::DFRN) { + } elseif (empty($contact["network"]) || ($contact["network"] != Protocol::DFRN)) { $contact = []; } @@ -568,7 +585,7 @@ class OStatus return; } - Item::delete($condition); + Item::markForDeletion($condition); Logger::log('Deleted item with uri '.$item['uri'].' for user '.$item['uid']); } @@ -1665,7 +1682,7 @@ class OStatus $entry = self::entryHeader($doc, $owner, $item, $toplevel); - $condition = ['uid' => $owner["uid"], 'guid' => $repeated_guid, 'private' => false, + $condition = ['uid' => $owner["uid"], 'guid' => $repeated_guid, 'private' => [Item::PUBLIC, Item::UNLISTED], 'network' => [Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS]]; $repeated_item = Item::selectFirst([], $condition); if (!DBA::isResult($repeated_item)) { @@ -1810,7 +1827,7 @@ class OStatus { $item["id"] = $item["parent"] = 0; $item["created"] = $item["edited"] = date("c"); - $item["private"] = true; + $item["private"] = Item::PRIVATE; $contact = Probe::uri($item['follow']); @@ -2103,7 +2120,7 @@ class OStatus ]); } - if (!$item["private"] && !$feed_mode) { + if (($item['private'] != Item::PRIVATE) && !$feed_mode) { XML::addElement($doc, $entry, "link", "", ["rel" => "ostatus:attention", "href" => "http://activityschema.org/collection/public"]); XML::addElement($doc, $entry, "link", "", ["rel" => "mentioned", @@ -2195,8 +2212,8 @@ class OStatus $authorid = Contact::getIdForURL($owner["url"], 0, true); $condition = ["`uid` = ? AND `received` > ? AND NOT `deleted` - AND NOT `private` AND `visible` AND `wall` AND `parent-network` IN (?, ?)", - $owner["uid"], $check_date, Protocol::OSTATUS, Protocol::DFRN]; + AND `private` != ? AND `visible` AND `wall` AND `parent-network` IN (?, ?)", + $owner["uid"], $check_date, Item::PRIVATE, Protocol::OSTATUS, Protocol::DFRN]; if ($filter === 'comments') { $condition[0] .= " AND `object-type` = ? ";