<?php
/**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
$header["private"] = Item::PUBLIC;
$header["verb"] = Activity::POST;
$header["object-type"] = Activity\ObjectType::NOTE;
+ $header["post-type"] = Item::PT_ARTICLE;
$header["contact-id"] = $contact["id"] ?? 0;
$item["body"] = trim($item["title"]);
}
- $data = ParseUrl::getSiteinfoCached($item['plink'], true);
+ $data = ParseUrl::getSiteinfoCached($item['plink']);
if (!empty($data['text']) && !empty($data['title']) && (mb_strlen($item['body']) < mb_strlen($data['text']))) {
// When the fetched page info text is longer than the body, we do try to enhance the body
if (!empty($item['body']) && (strpos($data['title'], $item['body']) === false) && (strpos($data['text'], $item['body']) === false)) {
}
}
+ if (empty($item['title'])) {
+ $item['post-type'] = Item::PT_NOTE;
+ }
+
Logger::info('Stored feed', ['item' => $item]);
$notify = Item::isRemoteSelf($contact, $item);
$params = ['order' => ['received' => true], 'limit' => $max_items];
if ($filter === 'posts') {
- $ret = Item::selectThread([], $condition, $params);
+ $ret = Post::selectThread(Item::DELIVER_FIELDLIST, $condition, $params);
} else {
- $ret = Item::select([], $condition, $params);
+ $ret = Post::select(Item::DELIVER_FIELDLIST, $condition, $params);
}
- $items = Item::toArray($ret);
+ $items = Post::toArray($ret);
$doc = new DOMDocument('1.0', 'utf-8');
$doc->formatOutput = true;
$condition = ['uid' => $owner["uid"], 'guid' => $repeated_guid, 'private' => [Item::PUBLIC, Item::UNLISTED],
'network' => Protocol::FEDERATED];
- $repeated_item = Post::selectFirst([], $condition);
+ $repeated_item = Post::selectFirst(Item::DELIVER_FIELDLIST, $condition);
if (!DBA::isResult($repeated_item)) {
return false;
}