fixing & cleaning

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/352/head
Maxence Lange 2019-03-05 16:25:08 -01:00
rodzic f74702f440
commit 1bd6e3f44f
16 zmienionych plików z 11 dodań i 21 usunięć

Wyświetl plik

@ -365,7 +365,7 @@ class AP {
break; break;
case Announce::TYPE: case Announce::TYPE:
$service = $this->announceInterface; $interface = $this->announceInterface;
break; break;
case Block::TYPE: case Block::TYPE:

Wyświetl plik

@ -32,10 +32,6 @@ namespace OCA\Social\Command;
use Exception; use Exception;
use OC\Core\Command\Base; use OC\Core\Command\Base;
use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Object\Announce;
use OCA\Social\Model\ActivityPub\Stream;
use OCA\Social\Model\Post;
use OCA\Social\Service\AccountService; use OCA\Social\Service\AccountService;
use OCA\Social\Service\ActivityService; use OCA\Social\Service\ActivityService;
use OCA\Social\Service\ConfigService; use OCA\Social\Service\ConfigService;
@ -45,7 +41,6 @@ use OCA\Social\Service\NoteService;
use OCA\Social\Service\PostService; use OCA\Social\Service\PostService;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;

Wyświetl plik

@ -290,6 +290,7 @@ class LocalController extends Controller {
/** /**
* @NoAdminRequired * @NoAdminRequired
* @NoCSRFRequired
* *
* @param int $since * @param int $since
* @param int $limit * @param int $limit

Wyświetl plik

@ -36,6 +36,7 @@ use Exception;
use OC\User\NoUserException; use OC\User\NoUserException;
use OCA\Social\AppInfo\Application; use OCA\Social\AppInfo\Application;
use OCA\Social\Exceptions\AccountAlreadyExistsException; use OCA\Social\Exceptions\AccountAlreadyExistsException;
use OCA\Social\Exceptions\ItemUnknownException;
use OCA\Social\Exceptions\SocialAppConfigException; use OCA\Social\Exceptions\SocialAppConfigException;
use OCA\Social\Exceptions\UrlCloudException; use OCA\Social\Exceptions\UrlCloudException;
use OCA\Social\Service\AccountService; use OCA\Social\Service\AccountService;
@ -130,6 +131,7 @@ class NavigationController extends Controller {
* *
* @return TemplateResponse * @return TemplateResponse
* @throws UrlCloudException * @throws UrlCloudException
* @throws ItemUnknownException
*/ */
public function navigate(string $path = ''): TemplateResponse { public function navigate(string $path = ''): TemplateResponse {
$data = [ $data = [

Wyświetl plik

@ -109,7 +109,7 @@ class OStatusController extends Controller {
$user = $this->userSession->getUser(); $user = $this->userSession->getUser();
if ($user === null) { if ($user === null) {
return $this->fail('Failed to retrieve current user'); throw new Exception('Failed to retrieve current user');
} }
return new TemplateResponse('social', 'ostatus', [ return new TemplateResponse('social', 'ostatus', [

Wyświetl plik

@ -32,11 +32,7 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools; use daita\MySmallPhpTools\Traits\TArrayTools;
use DateTime;
use OCA\Social\Exceptions\FollowDoesNotExistException;
use OCA\Social\Exceptions\HashtagDoesNotExistException; use OCA\Social\Exceptions\HashtagDoesNotExistException;
use OCA\Social\Model\ActivityPub\Activity\Follow;
use OCP\DB\QueryBuilder\IQueryBuilder;
/** /**

Wyświetl plik

@ -32,8 +32,6 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools; use daita\MySmallPhpTools\Traits\TArrayTools;
use OCA\Social\Exceptions\InvalidResourceException;
use OCA\Social\Model\ActivityPub\Activity\Follow;
use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\DB\QueryBuilder\IQueryBuilder;

Wyświetl plik

@ -73,7 +73,7 @@ class NotesRequest extends NotesRequestBuilder {
) )
->setValue( ->setValue(
'attachments', $qb->createNamedParameter( 'attachments', $qb->createNamedParameter(
json_encode($note->getAttachments(), JSON_UNESCAPED_SLASHES) json_encode($stream->getAttachments(), JSON_UNESCAPED_SLASHES)
) )
); );
} }

Wyświetl plik

@ -31,7 +31,6 @@ namespace OCA\Social\Db;
use daita\MySmallPhpTools\Traits\TArrayTools; use daita\MySmallPhpTools\Traits\TArrayTools;
use OCA\Social\Model\RequestQueue;
use OCA\Social\Model\StreamQueue; use OCA\Social\Model\StreamQueue;
use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\DB\QueryBuilder\IQueryBuilder;

Wyświetl plik

@ -39,7 +39,6 @@ use OCA\Social\Exceptions\InvalidOriginException;
use OCA\Social\Exceptions\ItemNotFoundException; use OCA\Social\Exceptions\ItemNotFoundException;
use OCA\Social\Interfaces\IActivityPubInterface; use OCA\Social\Interfaces\IActivityPubInterface;
use OCA\Social\Model\ActivityPub\ACore; use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Activity\Delete;
use OCA\Social\Model\ActivityPub\Activity\Update; use OCA\Social\Model\ActivityPub\Activity\Update;
use OCA\Social\Model\ActivityPub\Actor\Person; use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Service\ActorService; use OCA\Social\Service\ActorService;

Wyświetl plik

@ -35,7 +35,6 @@ use OCA\Social\Db\CacheDocumentsRequest;
use OCA\Social\Exceptions\ItemNotFoundException; use OCA\Social\Exceptions\ItemNotFoundException;
use OCA\Social\Interfaces\IActivityPubInterface; use OCA\Social\Interfaces\IActivityPubInterface;
use OCA\Social\Model\ActivityPub\ACore; use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Model\ActivityPub\Object\Document;
use OCA\Social\Service\MiscService; use OCA\Social\Service\MiscService;

Wyświetl plik

@ -32,6 +32,7 @@ namespace OCA\Social\Model\ActivityPub\Object;
use JsonSerializable; use JsonSerializable;
use OCA\Social\Exceptions\InvalidOriginException;
use OCA\Social\Exceptions\UrlCloudException; use OCA\Social\Exceptions\UrlCloudException;
use OCA\Social\Model\ActivityPub\ACore; use OCA\Social\Model\ActivityPub\ACore;
@ -63,6 +64,7 @@ class Image extends Document implements JsonSerializable {
* @param array $data * @param array $data
* *
* @throws UrlCloudException * @throws UrlCloudException
* @throws InvalidOriginException
*/ */
public function import(array $data) { public function import(array $data) {
parent::import($data); parent::import($data);

Wyświetl plik

@ -30,7 +30,6 @@ declare(strict_types=1);
namespace OCA\Social\Model\ActivityPub\Object; namespace OCA\Social\Model\ActivityPub\Object;
use DateTime;
use Exception; use Exception;
use JsonSerializable; use JsonSerializable;
use OCA\Social\AP; use OCA\Social\AP;
@ -48,7 +47,7 @@ class Note extends Stream implements JsonSerializable {
/** @var array */ /** @var array */
private $attachments = []; private $attachments = [];
/** @var array */ /** @var array */
private $hashtags = []; private $hashtags = [];

Wyświetl plik

@ -32,12 +32,10 @@ namespace OCA\Social\Model;
use daita\MySmallPhpTools\Traits\TArrayTools; use daita\MySmallPhpTools\Traits\TArrayTools;
use JsonLdException;
use JsonSerializable; use JsonSerializable;
use OCA\Social\Exceptions\LinkedDataSignatureMissingException; use OCA\Social\Exceptions\LinkedDataSignatureMissingException;
use OCA\Social\Model\ActivityPub\ACore; use OCA\Social\Model\ActivityPub\ACore;
use OCA\Social\Service\SignatureService; use OCA\Social\Service\SignatureService;
use stdClass;
/** /**

Wyświetl plik

@ -135,6 +135,7 @@ class CurlService {
* @throws RequestServerException * @throws RequestServerException
* @throws SocialAppConfigException * @throws SocialAppConfigException
* @throws ItemUnknownException * @throws ItemUnknownException
* @throws RequestResultNotJsonException
*/ */
public function retrieveAccount(string $account): Person { public function retrieveAccount(string $account): Person {
$result = $this->webfingerAccount($account); $result = $this->webfingerAccount($account);

Wyświetl plik

@ -181,6 +181,7 @@ class DocumentService {
* @throws CacheContentException * @throws CacheContentException
* @throws CacheDocumentDoesNotExistException * @throws CacheDocumentDoesNotExistException
* @throws MalformedArrayException * @throws MalformedArrayException
* @throws RequestResultNotJsonException
*/ */
public function getFromCache(string $id, bool $public = false) { public function getFromCache(string $id, bool $public = false) {
$document = $this->cacheRemoteDocument($id, $public); $document = $this->cacheRemoteDocument($id, $public);