Commit 190b6772 authored by Marcelo Rivera's avatar Marcelo Rivera

(fix): remove full exports

1 merge request!463Allow users to permanently hide "share" buttons in settings
Pipeline #117594820 failed with stages
in 42 seconds
......@@ -146,8 +146,6 @@ class blog implements Interfaces\Api
break;
}
$blog->setFullExport(true);
$response['blog'] = $blog;
}
break;
......
......@@ -43,8 +43,6 @@ class media implements Interfaces\Api, Interfaces\ApiIgnorePam
]);
}
$entity->fullExport = true;
switch ($entity->subtype) {
case "video":
// Helpers\Counters::increment($pages[0], 'plays');
......
......@@ -53,7 +53,6 @@ class newsfeed implements Interfaces\Api
if (!$activity->guid || Helpers\Flags::shouldFail($activity)) {
return Factory::response(['status' => 'error']);
}
$activity->fullExport = true;
return Factory::response(['activity' => $activity->export()]);
break;
default:
......
......@@ -97,8 +97,6 @@ use Minds\Traits\MagicAttributes;
* @method bool getAllowComments()
* @method int getTimeSent()
* @method Blog setTimeSent(int $time_sent)
* @method bool getFullExport()
* @method Blog setFullExport(bool $value)
*/
class Blog extends RepositoryEntity
{
......@@ -247,9 +245,6 @@ class Blog extends RepositoryEntity
/** @var int */
protected $timeSent;
/** @var bool */
protected $fullExport = false;
/**
* Blog constructor.
* @param null $eventsDispatcher
......@@ -332,7 +327,7 @@ class Blog extends RepositoryEntity
*/
public function getOwnerObj()
{
if ($this->fullExport || (!$this->ownerObj && $this->ownerGuid)) {
if (!$this->ownerObj && $this->ownerGuid) {
$user = new User($this->ownerGuid);
$this->setOwnerObj($user->export());
}
......@@ -478,9 +473,9 @@ class Blog extends RepositoryEntity
}
/**
* Get NSFW options
* @return array
*/
* Get NSFW options
* @return array
*/
public function getNsfw()
{
$array = [];
......
......@@ -31,8 +31,8 @@ class Defaults
}
$export = $event->response() ?: [];
if ($params['entity']->fullExport && $params['entity']->owner_guid) {
$export['ownerObj'] = Entities\Factory::build($params['entity']->owner_guid)->export();
if ($params['entity']->fullExport && $params['entity']->ownerObj && is_array($params['entity']->ownerObj)) {
$export['ownerObj'] = Entities\Factory::build($params['entity']->ownerObj)->export();
//$export['ownerObj'] = \Minds\Helpers\Export::sanitize($params['entity']->ownerObj);
// $export['ownerObj']['guid'] = (string) $params['entity']->ownerObj['guid'];
$event->setResponse($export);
......
Please register or to comment