summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-05-06 08:33:45 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-05-06 08:33:45 -0100
commit76997d0cd5c351e1e7afe2f067c08e536a862447 (patch)
treef68bdc09b5d87cb7f5135672a257f2181eef8bd5 /lib
parent9854c65e0a7976783dafa6f733d77d4a3882d6d9 (diff)
cleaning
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Db/CoreRequestBuilder.php13
-rw-r--r--lib/Db/NotesRequestBuilder.php3
-rw-r--r--lib/Model/ActivityPub/ACore.php2
3 files changed, 4 insertions, 14 deletions
diff --git a/lib/Db/CoreRequestBuilder.php b/lib/Db/CoreRequestBuilder.php
index 6a85c07c..2672c562 100644
--- a/lib/Db/CoreRequestBuilder.php
+++ b/lib/Db/CoreRequestBuilder.php
@@ -69,7 +69,6 @@ class CoreRequestBuilder {
const TABLE_STREAM_ACTIONS = 'social_stream_actions';
-
/** @var IDBConnection */
protected $dbConnection;
@@ -143,17 +142,6 @@ class CoreRequestBuilder {
/**
- * Limit the request to the Type
- *
- * @param IQueryBuilder $qb
- * @param string $type
- */
- protected function limitToType(IQueryBuilder &$qb, string $type) {
- $this->limitToDBField($qb, 'id', $type, false);
- }
-
-
- /**
* Limit the request to the UserId
*
* @param IQueryBuilder $qb
@@ -800,6 +788,7 @@ class CoreRequestBuilder {
*
* @return Document
* @throws InvalidResourceException
+ * @throws Exception
*/
protected function parseCacheDocumentsLeftJoin(array $data): Document {
$new = [];
diff --git a/lib/Db/NotesRequestBuilder.php b/lib/Db/NotesRequestBuilder.php
index 30e349de..151842cd 100644
--- a/lib/Db/NotesRequestBuilder.php
+++ b/lib/Db/NotesRequestBuilder.php
@@ -32,6 +32,7 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools;
use Doctrine\DBAL\Query\QueryBuilder;
+use Exception;
use OCA\Social\Exceptions\InvalidResourceException;
use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Actor\Person;
@@ -361,9 +362,11 @@ class NotesRequestBuilder extends CoreRequestBuilder {
* @param array $data
*
* @return Stream
+ * @throws Exception
*/
protected function parseNotesSelectSql($data): Stream {
$item = new Stream();
+ $item->importFromDatabase($data);
$instances = json_decode($this->get('instances', $data, '[]'), true);
if (is_array($instances)) {
diff --git a/lib/Model/ActivityPub/ACore.php b/lib/Model/ActivityPub/ACore.php
index 42c78152..e26fdf0f 100644
--- a/lib/Model/ActivityPub/ACore.php
+++ b/lib/Model/ActivityPub/ACore.php
@@ -595,7 +595,6 @@ class ACore extends Item implements JsonSerializable {
$this->setId($this->validate(self::AS_ID, 'id', $data, ''));
$this->setType($this->validate(self::AS_TYPE, 'type', $data, ''));
$this->setUrl($this->validate(self::AS_URL, 'url', $data, ''));
- $this->setAttributedTo($this->validate(self::AS_ID, 'attributed_to', $data, ''));
$this->setSummary($this->validate(self::AS_STRING, 'summary', $data, ''));
$this->setTo($this->validate(self::AS_ID, 'to', $data, ''));
$this->setToArray($this->validateArray(self::AS_ID, 'to_array', $data, []));
@@ -631,7 +630,6 @@ class ACore extends Item implements JsonSerializable {
$this->addEntry('id', $this->getId());
$this->addEntry('type', $this->getType());
$this->addEntry('url', $this->getUrl());
- $this->addEntry('attributedTo', $this->getAttributedTo());
$this->addEntry('to', $this->getTo());
$this->addEntryArray('to', $this->getToArray());
$this->addEntryArray('cc', $this->getCcArray());