kopia lustrzana https://github.com/nextcloud/social
				
				
				
			
							rodzic
							
								
									0af5100f3f
								
							
						
					
					
						commit
						09859970fb
					
				
							
								
								
									
										16
									
								
								lib/AP.php
								
								
								
								
							
							
						
						
									
										16
									
								
								lib/AP.php
								
								
								
								
							|  | @ -31,8 +31,6 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social; | ||||
| 
 | ||||
| use OCA\Social\Model\ActivityPub\OrderedCollection; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Exceptions\ItemUnknownException; | ||||
| use OCA\Social\Exceptions\RedundancyLimitException; | ||||
| use OCA\Social\Exceptions\SocialAppConfigException; | ||||
|  | @ -45,11 +43,11 @@ use OCA\Social\Interfaces\Activity\RejectInterface; | |||
| use OCA\Social\Interfaces\Activity\RemoveInterface; | ||||
| use OCA\Social\Interfaces\Activity\UndoInterface; | ||||
| use OCA\Social\Interfaces\Activity\UpdateInterface; | ||||
| use OCA\Social\Interfaces\Actor\PersonInterface; | ||||
| use OCA\Social\Interfaces\Actor\ServiceInterface; | ||||
| use OCA\Social\Interfaces\Actor\ApplicationInterface; | ||||
| use OCA\Social\Interfaces\Actor\GroupInterface; | ||||
| use OCA\Social\Interfaces\Actor\OrganizationInterface; | ||||
| use OCA\Social\Interfaces\Actor\ApplicationInterface; | ||||
| use OCA\Social\Interfaces\Actor\PersonInterface; | ||||
| use OCA\Social\Interfaces\Actor\ServiceInterface; | ||||
| use OCA\Social\Interfaces\IActivityPubInterface; | ||||
| use OCA\Social\Interfaces\Internal\SocialAppNotificationInterface; | ||||
| use OCA\Social\Interfaces\Object\AnnounceInterface; | ||||
|  | @ -68,11 +66,11 @@ use OCA\Social\Model\ActivityPub\Activity\Reject; | |||
| use OCA\Social\Model\ActivityPub\Activity\Remove; | ||||
| use OCA\Social\Model\ActivityPub\Activity\Undo; | ||||
| use OCA\Social\Model\ActivityPub\Activity\Update; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Person; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Service; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Application; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Group; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Organization; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Application; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Person; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Service; | ||||
| use OCA\Social\Model\ActivityPub\Internal\SocialAppNotification; | ||||
| use OCA\Social\Model\ActivityPub\Object\Announce; | ||||
| use OCA\Social\Model\ActivityPub\Object\Document; | ||||
|  | @ -81,8 +79,10 @@ use OCA\Social\Model\ActivityPub\Object\Image; | |||
| use OCA\Social\Model\ActivityPub\Object\Like; | ||||
| use OCA\Social\Model\ActivityPub\Object\Note; | ||||
| use OCA\Social\Model\ActivityPub\Object\Tombstone; | ||||
| use OCA\Social\Model\ActivityPub\OrderedCollection; | ||||
| use OCA\Social\Model\ActivityPub\Stream; | ||||
| use OCA\Social\Service\ConfigService; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCP\AppFramework\QueryException; | ||||
| use OCP\Server; | ||||
| use Psr\Log\LoggerInterface; | ||||
|  |  | |||
|  | @ -70,8 +70,8 @@ class CacheRefresh extends Base { | |||
| 	 * @throws Exception | ||||
| 	 */ | ||||
| 	protected function execute(InputInterface $input, OutputInterface $output): int { | ||||
| //		$result = $this->accountService->blindKeyRotation();
 | ||||
| //		$output->writeLn($result . ' key pairs refreshed');
 | ||||
| 		//		$result = $this->accountService->blindKeyRotation();
 | ||||
| 		//		$output->writeLn($result . ' key pairs refreshed');
 | ||||
| 
 | ||||
| 		$result = $this->accountService->manageDeletedActors(); | ||||
| 		$output->writeLn($result . ' local accounts deleted'); | ||||
|  |  | |||
|  | @ -102,9 +102,9 @@ class CheckInstall extends Base { | |||
| 			return 0; | ||||
| 		} | ||||
| 
 | ||||
| //		if ($this->checkPushApp($input, $output)) {
 | ||||
| //			return;
 | ||||
| //		}
 | ||||
| 		//		if ($this->checkPushApp($input, $output)) {
 | ||||
| 		//			return;
 | ||||
| 		//		}
 | ||||
| 
 | ||||
| 		$result = $this->checkService->checkInstallationStatus(); | ||||
| 
 | ||||
|  | @ -137,9 +137,9 @@ class CheckInstall extends Base { | |||
| 		} | ||||
| 
 | ||||
| 		// push was not implemented on 18
 | ||||
| //		$wrapper = $this->pushService->testOnAccount($userId);
 | ||||
| 		//		$wrapper = $this->pushService->testOnAccount($userId);
 | ||||
| 
 | ||||
| //		$output->writeln(json_encode($wrapper, JSON_PRETTY_PRINT));
 | ||||
| 		//		$output->writeln(json_encode($wrapper, JSON_PRETTY_PRINT));
 | ||||
| 
 | ||||
| 		return true; | ||||
| 	} | ||||
|  |  | |||
|  | @ -278,9 +278,9 @@ class ActivityPubController extends Controller { | |||
| 	 * @return Response | ||||
| 	 */ | ||||
| 	public function outbox(string $username): Response { | ||||
| //		if (!$this->checkSourceActivityStreams()) {
 | ||||
| //			return $this->socialPubController->outbox($username);
 | ||||
| //		}
 | ||||
| 		//		if (!$this->checkSourceActivityStreams()) {
 | ||||
| 		//			return $this->socialPubController->outbox($username);
 | ||||
| 		//		}
 | ||||
| 
 | ||||
| 		try { | ||||
| 			$actor = $this->cacheActorService->getFromLocalAccount($username); | ||||
|  |  | |||
|  | @ -26,13 +26,13 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Controller; | ||||
| 
 | ||||
| use OCA\Social\Tools\Model\SimpleDataStore; | ||||
| use OCA\Social\Tools\Traits\TNCDataResponse; | ||||
| use Exception; | ||||
| use OCA\Social\Exceptions\SocialAppConfigException; | ||||
| use OCA\Social\Service\ConfigService; | ||||
| use OCA\Social\Service\MiscService; | ||||
| use OCA\Social\Service\TestService; | ||||
| use OCA\Social\Tools\Model\SimpleDataStore; | ||||
| use OCA\Social\Tools\Traits\TNCDataResponse; | ||||
| use OCP\AppFramework\Controller; | ||||
| use OCP\AppFramework\Http; | ||||
| use OCP\AppFramework\Http\DataResponse; | ||||
|  |  | |||
|  | @ -31,8 +31,6 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Controller; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TNCDataResponse; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use Exception; | ||||
| use OCA\Social\AppInfo\Application; | ||||
| use OCA\Social\Exceptions\AccountDoesNotExistException; | ||||
|  | @ -53,6 +51,8 @@ use OCA\Social\Service\MiscService; | |||
| use OCA\Social\Service\PostService; | ||||
| use OCA\Social\Service\SearchService; | ||||
| use OCA\Social\Service\StreamService; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Tools\Traits\TNCDataResponse; | ||||
| use OCP\AppFramework\Controller; | ||||
| use OCP\AppFramework\Http; | ||||
| use OCP\AppFramework\Http\DataResponse; | ||||
|  |  | |||
|  | @ -31,10 +31,7 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Controller; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TNCDataResponse; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use Exception; | ||||
| use OCP\AppFramework\Http; | ||||
| use OC\User\NoUserException; | ||||
| use OCA\Social\AppInfo\Application; | ||||
| use OCA\Social\Exceptions\AccountAlreadyExistsException; | ||||
|  | @ -45,16 +42,19 @@ use OCA\Social\Service\CheckService; | |||
| use OCA\Social\Service\ConfigService; | ||||
| use OCA\Social\Service\DocumentService; | ||||
| use OCA\Social\Service\MiscService; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Tools\Traits\TNCDataResponse; | ||||
| use OCP\AppFramework\Controller; | ||||
| use OCP\AppFramework\Http; | ||||
| use OCP\AppFramework\Http\FileDisplayResponse; | ||||
| use OCP\AppFramework\Http\Response; | ||||
| use OCP\AppFramework\Http\TemplateResponse; | ||||
| use OCP\IConfig; | ||||
| use OCP\IGroupManager; | ||||
| use OCP\IInitialStateService; | ||||
| use OCP\IL10N; | ||||
| use OCP\IRequest; | ||||
| use OCP\IURLGenerator; | ||||
| use OCP\IGroupManager; | ||||
| use OCP\Server; | ||||
| 
 | ||||
| /** | ||||
|  |  | |||
|  | @ -31,9 +31,6 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Controller; | ||||
| 
 | ||||
| use OCA\Social\Tools\Exceptions\ArrayNotFoundException; | ||||
| use OCA\Social\Tools\Traits\TNCDataResponse; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use Exception; | ||||
| use OCA\Social\AppInfo\Application; | ||||
| use OCA\Social\Exceptions\InvalidResourceException; | ||||
|  | @ -42,6 +39,9 @@ use OCA\Social\Service\AccountService; | |||
| use OCA\Social\Service\CacheActorService; | ||||
| use OCA\Social\Service\CurlService; | ||||
| use OCA\Social\Service\MiscService; | ||||
| use OCA\Social\Tools\Exceptions\ArrayNotFoundException; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Tools\Traits\TNCDataResponse; | ||||
| use OCP\AppFramework\Controller; | ||||
| use OCP\AppFramework\Http\Response; | ||||
| use OCP\AppFramework\Http\TemplateResponse; | ||||
|  |  | |||
|  | @ -30,13 +30,13 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Controller; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TAsync; | ||||
| use OCA\Social\AppInfo\Application; | ||||
| use OCA\Social\Exceptions\SocialAppConfigException; | ||||
| use OCA\Social\Model\RequestQueue; | ||||
| use OCA\Social\Service\ActivityService; | ||||
| use OCA\Social\Service\MiscService; | ||||
| use OCA\Social\Service\RequestQueueService; | ||||
| use OCA\Social\Tools\Traits\TAsync; | ||||
| use OCP\AppFramework\Controller; | ||||
| use OCP\IRequest; | ||||
| 
 | ||||
|  |  | |||
|  | @ -31,7 +31,6 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Controller; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TNCDataResponse; | ||||
| use Exception; | ||||
| use OCA\Social\AppInfo\Application; | ||||
| use OCA\Social\Exceptions\AccountDoesNotExistException; | ||||
|  | @ -43,6 +42,7 @@ use OCA\Social\Service\AccountService; | |||
| use OCA\Social\Service\CacheActorService; | ||||
| use OCA\Social\Service\ConfigService; | ||||
| use OCA\Social\Service\StreamService; | ||||
| use OCA\Social\Tools\Traits\TNCDataResponse; | ||||
| use OCP\AppFramework\Controller; | ||||
| use OCP\AppFramework\Http; | ||||
| use OCP\AppFramework\Http\Response; | ||||
|  |  | |||
|  | @ -32,13 +32,13 @@ declare(strict_types=1); | |||
| namespace OCA\Social\Cron; | ||||
| 
 | ||||
| use Exception; | ||||
| use OCP\AppFramework\Utility\ITimeFactory; | ||||
| use OCP\BackgroundJob\TimedJob; | ||||
| use OCA\Social\Service\AccountService; | ||||
| use OCA\Social\Service\CacheActorService; | ||||
| use OCA\Social\Service\DocumentService; | ||||
| use OCA\Social\Service\HashtagService; | ||||
| use OCP\AppFramework\QueryException; | ||||
| use OCP\AppFramework\Utility\ITimeFactory; | ||||
| use OCP\BackgroundJob\TimedJob; | ||||
| 
 | ||||
| /** | ||||
|  * Class Cache | ||||
|  | @ -67,7 +67,7 @@ class Cache extends TimedJob { | |||
| 	 */ | ||||
| 	protected function run($argument) { | ||||
| 		try { | ||||
| //			$this->accountService->blindKeyRotation();
 | ||||
| 			//			$this->accountService->blindKeyRotation();
 | ||||
| 		} catch (Exception $e) { | ||||
| 		} | ||||
| 
 | ||||
|  |  | |||
|  | @ -31,13 +31,13 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Cron; | ||||
| 
 | ||||
| use OCP\AppFramework\Utility\ITimeFactory; | ||||
| use OCP\BackgroundJob\TimedJob; | ||||
| use OCA\Social\Exceptions\SocialAppConfigException; | ||||
| use OCA\Social\Service\ActivityService; | ||||
| use OCA\Social\Service\RequestQueueService; | ||||
| use OCA\Social\Service\StreamQueueService; | ||||
| use OCP\AppFramework\QueryException; | ||||
| use OCP\AppFramework\Utility\ITimeFactory; | ||||
| use OCP\BackgroundJob\TimedJob; | ||||
| 
 | ||||
| /** | ||||
|  * Class Queue | ||||
|  |  | |||
|  | @ -23,10 +23,10 @@ | |||
| 
 | ||||
| namespace OCA\Social\Dashboard; | ||||
| 
 | ||||
| use OCP\IURLGenerator; | ||||
| use OCA\Social\AppInfo\Application; | ||||
| use OCP\Dashboard\IWidget; | ||||
| use OCP\IL10N; | ||||
| use OCA\Social\AppInfo\Application; | ||||
| use OCP\IURLGenerator; | ||||
| 
 | ||||
| class SocialWidget implements IWidget { | ||||
| 	private IL10N $l10n; | ||||
|  |  | |||
|  | @ -30,9 +30,9 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Exceptions\SocialAppConfigException; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Person; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| class ActorsRequestBuilder extends CoreRequestBuilder { | ||||
| 	use TArrayTools; | ||||
|  |  | |||
|  | @ -30,8 +30,8 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Model\ActivityPub\Object\Document; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| class CacheDocumentsRequestBuilder extends CoreRequestBuilder { | ||||
| 	use TArrayTools; | ||||
|  |  | |||
|  | @ -31,12 +31,12 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use DateTime; | ||||
| use Exception; | ||||
| use OCA\Social\Exceptions\ClientNotFoundException; | ||||
| use OCA\Social\Model\Client\SocialClient; | ||||
| use OCA\Social\Service\ClientService; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCP\DB\QueryBuilder\IQueryBuilder; | ||||
| 
 | ||||
| /** | ||||
|  |  | |||
|  | @ -31,11 +31,11 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Exceptions\RowNotFoundException; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use Exception; | ||||
| use OCA\Social\Exceptions\ClientNotFoundException; | ||||
| use OCA\Social\Model\Client\SocialClient; | ||||
| use OCA\Social\Tools\Exceptions\RowNotFoundException; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class ClientRequestBuilder | ||||
|  |  | |||
|  | @ -1094,10 +1094,10 @@ class CoreRequestBuilder { | |||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| //		$action = new Action();
 | ||||
| //		$action->importFromDatabase($new);
 | ||||
| 		//		$action = new Action();
 | ||||
| 		//		$action->importFromDatabase($new);
 | ||||
| 
 | ||||
| //		return $action;
 | ||||
| 		//		return $action;
 | ||||
| 	} | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -31,11 +31,11 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Exceptions\RowNotFoundException; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Exceptions\FollowNotFoundException; | ||||
| use OCA\Social\Exceptions\InvalidResourceException; | ||||
| use OCA\Social\Model\ActivityPub\Object\Follow; | ||||
| use OCA\Social\Tools\Exceptions\RowNotFoundException; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class FollowsRequestBuilder | ||||
|  |  | |||
|  | @ -31,8 +31,8 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Exceptions\HashtagDoesNotExistException; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class HashtagsRequest | ||||
|  |  | |||
|  | @ -31,10 +31,10 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Exceptions\InstanceDoesNotExistException; | ||||
| use OCA\Social\Model\ActivityPub\ACore; | ||||
| use OCA\Social\Model\Instance; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCP\DB\QueryBuilder\IQueryBuilder; | ||||
| 
 | ||||
| /** | ||||
|  | @ -51,8 +51,8 @@ class InstancesRequest extends InstancesRequestBuilder { | |||
| 	 * TODO: store instance in db | ||||
| 	 */ | ||||
| 	public function save(Instance $instance) { | ||||
| //		$now = new DateTime('now');
 | ||||
| //		$instance->setCreation($now->getTimestamp());
 | ||||
| 		//		$now = new DateTime('now');
 | ||||
| 		//		$instance->setCreation($now->getTimestamp());
 | ||||
| 
 | ||||
| 		$qb = $this->getInstanceInsertSql(); | ||||
| 		$qb->setValue('uri', $qb->createNamedParameter($instance->getUri())) | ||||
|  |  | |||
|  | @ -30,8 +30,8 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Model\RequestQueue; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| class RequestQueueRequestBuilder extends CoreRequestBuilder { | ||||
| 	use TArrayTools; | ||||
|  |  | |||
|  | @ -31,9 +31,9 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Db\ExtendedQueryBuilder; | ||||
| use OC\SystemConfig; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Person; | ||||
| use OCA\Social\Tools\Db\ExtendedQueryBuilder; | ||||
| use OCP\IDBConnection; | ||||
| use OCP\IURLGenerator; | ||||
| use Psr\Log\LoggerInterface; | ||||
|  |  | |||
|  | @ -54,7 +54,7 @@ class SocialFiltersQueryBuilder extends SocialLimitsQueryBuilder { | |||
| 
 | ||||
| 		$follower = $expr->andX(); | ||||
| 		$follower->add($this->exprLimitToDBField('attributed_to_prim', $this->prim($viewer->getId()), false)); | ||||
| //		$follower->add($expr->isNull('fs.id_prim'));
 | ||||
| 		//		$follower->add($expr->isNull('fs.id_prim'));
 | ||||
| 		$filter->add($follower); | ||||
| 
 | ||||
| 		$this->andWhere($filter); | ||||
|  |  | |||
|  | @ -31,12 +31,12 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Exceptions\DateTimeException; | ||||
| use DateInterval; | ||||
| use DateTime; | ||||
| use Exception; | ||||
| use OCA\Social\Model\ActivityPub\ACore; | ||||
| use OCA\Social\Model\Client\Options\ProbeOptions; | ||||
| use OCA\Social\Tools\Exceptions\DateTimeException; | ||||
| use OCP\DB\QueryBuilder\ICompositeExpression; | ||||
| 
 | ||||
| /** | ||||
|  |  | |||
|  | @ -30,8 +30,8 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Model\StreamAction; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class StreamActionsRequestBuilder | ||||
|  |  | |||
|  | @ -30,8 +30,8 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Model\StreamQueue; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| class StreamQueueRequestBuilder extends CoreRequestBuilder { | ||||
| 	use TArrayTools; | ||||
|  |  | |||
|  | @ -149,7 +149,7 @@ class StreamRequestBuilder extends CoreRequestBuilder { | |||
| 		$follow = $expr->andX(); | ||||
| 		$follow->add($expr->eq($aliasFollow . '.type', $qb->createNamedParameter('Follow'))); | ||||
| 		// might be overkill to check object_id and also seems to filter boosted message
 | ||||
| //		$follow->add($expr->eq($alias . '.id_prim', $aliasFollow . '.object_id_prim'));
 | ||||
| 		//		$follow->add($expr->eq($alias . '.id_prim', $aliasFollow . '.object_id_prim'));
 | ||||
| 		$orX->add($follow); | ||||
| 
 | ||||
| 		$loopback = $expr->andX(); | ||||
|  |  | |||
|  | @ -31,11 +31,11 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| use OCA\Social\Model\ActivityPub\Object\Note; | ||||
| use OCA\Social\Model\ActivityPub\Stream; | ||||
| use OCP\Server; | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| use OCP\DB\Exception as DBException; | ||||
| use OCP\Server; | ||||
| use Psr\Log\LoggerInterface; | ||||
| 
 | ||||
| /** | ||||
|  |  | |||
|  | @ -331,7 +331,7 @@ class AnnounceInterface extends AbstractActivityPubInterface implements IActivit | |||
| 		} catch (StreamNotFoundException $e) { | ||||
| 			/** @var SocialAppNotification $notification */ | ||||
| 			$notification = AP::$activityPub->getItemFromType(SocialAppNotification::TYPE); | ||||
| //			$notification->setDetail('url', '');
 | ||||
| 			//			$notification->setDetail('url', '');
 | ||||
| 
 | ||||
| 			$notification->setDetailItem('post', $post); | ||||
| 			$notification->addDetail('accounts', $author->getAccount()); | ||||
|  |  | |||
|  | @ -94,7 +94,7 @@ class FollowInterface extends AbstractActivityPubInterface implements IActivityP | |||
| 			$accept->generateUniqueId('#accept/follows'); | ||||
| 			$accept->setActorId($follow->getObjectId()); | ||||
| 			$accept->setObject($follow); | ||||
| //			$follow->setParent($accept);
 | ||||
| 			//			$follow->setParent($accept);
 | ||||
| 
 | ||||
| 			$accept->addInstancePath( | ||||
| 				new InstancePath( | ||||
|  |  | |||
|  | @ -172,9 +172,9 @@ class LikeInterface extends AbstractActivityPubInterface implements IActivityPub | |||
| 	} | ||||
| 
 | ||||
| 	private function updateDetails(Stream $post): void { | ||||
| //		if (!$post->isLocal()) {
 | ||||
| //			return;
 | ||||
| //		}
 | ||||
| 		//		if (!$post->isLocal()) {
 | ||||
| 		//			return;
 | ||||
| 		//		}
 | ||||
| 
 | ||||
| 		$post->setDetailInt( | ||||
| 			'likes', $this->actionsRequest->countActions($post->getId(), Like::TYPE) | ||||
|  | @ -209,7 +209,7 @@ class LikeInterface extends AbstractActivityPubInterface implements IActivityPub | |||
| 		} catch (StreamNotFoundException $e) { | ||||
| 			/** @var SocialAppNotification $notification */ | ||||
| 			$notification = AP::$activityPub->getItemFromType(SocialAppNotification::TYPE); | ||||
| //			$notification->setDetail('url', '');
 | ||||
| 			//			$notification->setDetail('url', '');
 | ||||
| 			$notification->setDetailItem('post', $post); | ||||
| 			$notification->addDetail('accounts', $author->getAccount()); | ||||
| 			$notification->setAttributedTo($author->getId()) | ||||
|  |  | |||
|  | @ -386,7 +386,7 @@ class ACore extends Item implements JsonSerializable, IQueryRow { | |||
| 	 */ | ||||
| 	public function addEntry(string $k, string $v): ACore { | ||||
| 		if ($v === '') { | ||||
| //			unset($this->entries[$k]);
 | ||||
| 			//			unset($this->entries[$k]);
 | ||||
| 
 | ||||
| 			return $this; | ||||
| 		} | ||||
|  | @ -436,7 +436,7 @@ class ACore extends Item implements JsonSerializable, IQueryRow { | |||
| 	 */ | ||||
| 	public function addEntryArray(string $k, array $v): ACore { | ||||
| 		if ($v === []) { | ||||
| //			unset($this->entries[$k]);
 | ||||
| 			//			unset($this->entries[$k]);
 | ||||
| 
 | ||||
| 			return $this; | ||||
| 		} | ||||
|  | @ -455,7 +455,7 @@ class ACore extends Item implements JsonSerializable, IQueryRow { | |||
| 	 */ | ||||
| 	public function addEntryItem(string $k, ACore $v): ACore { | ||||
| 		if ($v === null) { | ||||
| //			unset($this->entries[$k]);
 | ||||
| 			//			unset($this->entries[$k]);
 | ||||
| 
 | ||||
| 			return $this; | ||||
| 		} | ||||
|  |  | |||
|  | @ -74,7 +74,7 @@ class SocialAppNotification extends Stream implements JsonSerializable { | |||
| 	 * @return array | ||||
| 	 */ | ||||
| 	public function jsonSerialize(): array { | ||||
| //		$this->addEntryInt('publishedTime', $this->getPublishedTime());
 | ||||
| 		//		$this->addEntryInt('publishedTime', $this->getPublishedTime());
 | ||||
| 
 | ||||
| 		return array_merge( | ||||
| 			parent::jsonSerialize(), | ||||
|  |  | |||
|  | @ -66,7 +66,7 @@ class Announce extends Stream implements JsonSerializable { | |||
| 		parent::import($data); | ||||
| 
 | ||||
| 		// Might be better to create 'actor_id' field in the 'server_streams' table.
 | ||||
| //		$this->setAttributedTo($this->getActorId());
 | ||||
| 		//		$this->setAttributedTo($this->getActorId());
 | ||||
| 	} | ||||
| 
 | ||||
| 	/** | ||||
|  |  | |||
|  | @ -31,9 +31,9 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Model\ActivityPub\Object; | ||||
| 
 | ||||
| use OCA\Social\Tools\IQueryRow; | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Model\ActivityPub\ACore; | ||||
| use OCA\Social\Tools\IQueryRow; | ||||
| 
 | ||||
| /** | ||||
|  * Class Follow | ||||
|  |  | |||
|  | @ -568,7 +568,7 @@ class Stream extends ACore implements IQueryRow, JsonSerializable { | |||
| 		$actor->importFromLocal($this->getArray('account', $data)); | ||||
| 		$actor->setExportFormat(ACore::FORMAT_LOCAL); | ||||
| 		$this->setActor($actor); | ||||
| //		$this->setCompleteDetails(true);
 | ||||
| 		//		$this->setCompleteDetails(true);
 | ||||
| 	} | ||||
| 
 | ||||
| 
 | ||||
|  | @ -711,7 +711,7 @@ class Stream extends ACore implements IQueryRow, JsonSerializable { | |||
| 	public function jsonSerialize(): array { | ||||
| 		$result = parent::jsonSerialize(); | ||||
| 
 | ||||
| //		$result['media_attachments'] = $this->getAttachments();
 | ||||
| 		//		$result['media_attachments'] = $this->getAttachments();
 | ||||
| 		$result['attachment'] = $this->getAttachments(); | ||||
| 
 | ||||
| 		return $result; | ||||
|  |  | |||
|  | @ -31,11 +31,11 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Model\Client; | ||||
| 
 | ||||
| use OCA\Social\Tools\IQueryRow; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use DateTime; | ||||
| use Exception; | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\IQueryRow; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class ClientApp | ||||
|  | @ -60,8 +60,8 @@ class SocialClient implements IQueryRow, JsonSerializable { | |||
| 	private string $token = ''; | ||||
| 	private int $creation = -1; | ||||
| 
 | ||||
| //	/** @var array */
 | ||||
| //	private $tokenScopes = [];
 | ||||
| 	//	/** @var array */
 | ||||
| 	//	private $tokenScopes = [];
 | ||||
| 
 | ||||
| 
 | ||||
| 	/** | ||||
|  |  | |||
|  | @ -30,10 +30,10 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Model; | ||||
| 
 | ||||
| use OCA\Social\Tools\IQueryRow; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Person; | ||||
| use OCA\Social\Tools\IQueryRow; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class Instance | ||||
|  | @ -274,8 +274,8 @@ class Instance implements IQueryRow, JsonSerializable { | |||
| 		$this->setLanguages($this->getArray('languages', $data)); | ||||
| 		$this->setAccountPrim($this->get('account_prim', $data)); | ||||
| 
 | ||||
| //		$contact = new Person();
 | ||||
| //		$this->setContactAccount($contact);
 | ||||
| 		//		$contact = new Person();
 | ||||
| 		//		$this->setContactAccount($contact);
 | ||||
| 
 | ||||
| 		return $this; | ||||
| 	} | ||||
|  |  | |||
|  | @ -30,8 +30,8 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Model; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class InstancePath | ||||
|  |  | |||
|  | @ -201,9 +201,9 @@ class LinkedDataSignature implements JsonSerializable { | |||
| 	 * @throws LinkedDataSignatureMissingException | ||||
| 	 */ | ||||
| 	public function import(array $data): void { | ||||
| //		if (!in_array(ACore::CONTEXT_SECURITY, $this->getArray('@context', $data, []))) {
 | ||||
| //			throw new LinkedDataSignatureMissingException('no @context security entry');
 | ||||
| //		}
 | ||||
| 		//		if (!in_array(ACore::CONTEXT_SECURITY, $this->getArray('@context', $data, []))) {
 | ||||
| 		//			throw new LinkedDataSignatureMissingException('no @context security entry');
 | ||||
| 		//		}
 | ||||
| 
 | ||||
| 		$signature = $this->getArray('signature', $data, []); | ||||
| 		if ($signature === []) { | ||||
|  |  | |||
|  | @ -31,11 +31,11 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Model; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| use DateTime; | ||||
| use Exception; | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class RequestQueue | ||||
|  |  | |||
|  | @ -31,9 +31,9 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Model; | ||||
| 
 | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| use JsonSerializable; | ||||
| 
 | ||||
| /** | ||||
|  * Class StreamAction | ||||
|  |  | |||
|  | @ -31,10 +31,10 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Model; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Person; | ||||
| use OCA\Social\Model\ActivityPub\Stream; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class StreamDetails | ||||
|  |  | |||
|  | @ -31,10 +31,10 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Model; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use DateTime; | ||||
| use Exception; | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class StreamQueue | ||||
|  |  | |||
|  | @ -30,9 +30,9 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Model; | ||||
| 
 | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\Model\SimpleDataStore; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use JsonSerializable; | ||||
| 
 | ||||
| /** | ||||
|  * Class Test | ||||
|  |  | |||
|  | @ -152,7 +152,7 @@ class UnifiedSearchProvider implements IProvider { | |||
| 			$this->convertHashtags($this->searchService->searchHashtags($search)) | ||||
| 		); | ||||
| 
 | ||||
| //	$this->searchService->searchStreamContent($search)
 | ||||
| 		//	$this->searchService->searchStreamContent($search)
 | ||||
| 
 | ||||
| 		return SearchResult::paginated( | ||||
| 			$this->l10n->t('Social'), $result, ($query->getCursor() ?? 0) + $query->getLimit() | ||||
|  |  | |||
|  | @ -117,17 +117,17 @@ class ActivityService { | |||
| 		$activity = new Create(); | ||||
| 		$item->setParent($activity); | ||||
| 
 | ||||
| //		$this->activityStreamsService->initCore($activity);
 | ||||
| 		//		$this->activityStreamsService->initCore($activity);
 | ||||
| 
 | ||||
| 		$activity->setObject($item); | ||||
| 		$activity->setId($item->getId() . '/activity'); | ||||
| 		$activity->setInstancePaths($item->getInstancePaths()); | ||||
| 
 | ||||
| //		if ($item->getToArray() !== []) {
 | ||||
| //			$activity->setToArray($item->getToArray());
 | ||||
| //		} else {
 | ||||
| //			$activity->setTo($item->getTo());
 | ||||
| //		}
 | ||||
| 		//		if ($item->getToArray() !== []) {
 | ||||
| 		//			$activity->setToArray($item->getToArray());
 | ||||
| 		//		} else {
 | ||||
| 		//			$activity->setTo($item->getTo());
 | ||||
| 		//		}
 | ||||
| 
 | ||||
| 		$activity->setActor($actor); | ||||
| 		$this->signatureService->signObject($actor, $activity); | ||||
|  |  | |||
|  | @ -30,7 +30,6 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\AP; | ||||
| use OCA\Social\Db\CacheActorsRequest; | ||||
| use OCA\Social\Db\CacheDocumentsRequest; | ||||
|  | @ -39,6 +38,7 @@ use OCA\Social\Exceptions\CacheDocumentDoesNotExistException; | |||
| use OCA\Social\Exceptions\ItemAlreadyExistsException; | ||||
| use OCA\Social\Exceptions\ItemUnknownException; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Person; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class ActorService | ||||
|  |  | |||
|  | @ -108,10 +108,10 @@ class BoostService { | |||
| 
 | ||||
| 		$interface = AP::$activityPub->getInterfaceFromType(Announce::TYPE); | ||||
| 		// TODO: check that announce does not exist already ?
 | ||||
| //		try {
 | ||||
| //			return $interface->getItem($announce);
 | ||||
| //		} catch (ItemNotFoundException $e) {
 | ||||
| //		}
 | ||||
| 		//		try {
 | ||||
| 		//			return $interface->getItem($announce);
 | ||||
| 		//		} catch (ItemNotFoundException $e) {
 | ||||
| 		//		}
 | ||||
| 
 | ||||
| 		$interface->save($announce); | ||||
| 
 | ||||
|  |  | |||
|  | @ -23,8 +23,6 @@ | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| use Exception; | ||||
| use GuzzleHttp\Exception\ClientException; | ||||
| use OC\User\NoUserException; | ||||
|  | @ -40,6 +38,8 @@ use OCA\Social\Exceptions\SocialAppConfigException; | |||
| use OCA\Social\Exceptions\UrlCloudException; | ||||
| use OCA\Social\Model\ActivityPub\Object\Follow; | ||||
| use OCA\Social\Model\ActivityPub\Object\Note; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| use OCP\AppFramework\Http; | ||||
| use OCP\Http\Client\IClientService; | ||||
| use OCP\ICache; | ||||
|  | @ -163,8 +163,8 @@ class CheckService { | |||
| 			]; | ||||
| 		} | ||||
| 
 | ||||
| //		$this->checkStatusTableFollows();
 | ||||
| //		$this->checkStatusTableStreamDest();
 | ||||
| 		//		$this->checkStatusTableFollows();
 | ||||
| 		//		$this->checkStatusTableStreamDest();
 | ||||
| 		try { | ||||
| 			$this->checkLocalAccountFollowingItself(); | ||||
| 		} catch (Exception $e) { | ||||
|  |  | |||
|  | @ -30,12 +30,12 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| use Exception; | ||||
| use OCA\Social\Db\ClientRequest; | ||||
| use OCA\Social\Exceptions\ClientException; | ||||
| use OCA\Social\Exceptions\ClientNotFoundException; | ||||
| use OCA\Social\Model\Client\SocialClient; | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class ClientService | ||||
|  | @ -44,8 +44,8 @@ use OCA\Social\Model\Client\SocialClient; | |||
|  */ | ||||
| class ClientService { | ||||
| 	public const TIME_TOKEN_REFRESH = 300; // 5m
 | ||||
| //	const TIME_TOKEN_TTL = 21600; // 6h
 | ||||
| //	const TIME_AUTH_TTL = 30672000; // 1y
 | ||||
| 	//	const TIME_TOKEN_TTL = 21600; // 6h
 | ||||
| 	//	const TIME_AUTH_TTL = 30672000; // 1y
 | ||||
| 
 | ||||
| 	// looks like there is no token refresh. token must have been updated in the last year.
 | ||||
| 	public const TIME_TOKEN_TTL = 30672000; // 1y
 | ||||
|  | @ -97,7 +97,7 @@ class ClientService { | |||
| 	 */ | ||||
| 	public function authClient(SocialClient $client) { | ||||
| 		$client->setAuthCode($this->token(60)); | ||||
| //		$clientAuth->setClientId($client->getId());
 | ||||
| 		//		$clientAuth->setClientId($client->getId());
 | ||||
| 
 | ||||
| 		$this->clientRequest->authClient($client); | ||||
| 	} | ||||
|  |  | |||
|  | @ -31,14 +31,14 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Exceptions\DateTimeException; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Db\HashtagsRequest; | ||||
| use OCA\Social\Db\StreamRequest; | ||||
| use OCA\Social\Exceptions\HashtagDoesNotExistException; | ||||
| use OCA\Social\Exceptions\ItemUnknownException; | ||||
| use OCA\Social\Exceptions\SocialAppConfigException; | ||||
| use OCA\Social\Model\ActivityPub\Object\Note; | ||||
| use OCA\Social\Tools\Exceptions\DateTimeException; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| class HashtagService { | ||||
| 	public const TREND_1H = 3600; | ||||
|  |  | |||
|  | @ -31,16 +31,16 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| use Exception; | ||||
| use OCA\Social\AP; | ||||
| use OCA\Social\Exceptions\ActivityPubFormatException; | ||||
| use OCA\Social\Exceptions\InvalidOriginException; | ||||
| use OCA\Social\Exceptions\ItemUnknownException; | ||||
| use OCA\Social\Exceptions\RedundancyLimitException; | ||||
| use OCA\Social\Exceptions\SocialAppConfigException; | ||||
| use OCA\Social\Exceptions\ItemUnknownException; | ||||
| use OCA\Social\Model\ActivityPub\ACore; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| 
 | ||||
| class ImportService { | ||||
| 	use TArrayTools; | ||||
|  |  | |||
|  | @ -31,12 +31,12 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\AppInfo\Application; | ||||
| use OCA\Social\Db\InstancesRequest; | ||||
| use OCA\Social\Exceptions\InstanceDoesNotExistException; | ||||
| use OCA\Social\Model\ActivityPub\ACore; | ||||
| use OCA\Social\Model\Instance; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCP\IConfig; | ||||
| 
 | ||||
| class InstanceService { | ||||
|  |  | |||
|  | @ -31,7 +31,6 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| use Exception; | ||||
| use OCA\Social\AP; | ||||
| use OCA\Social\Db\StreamRequest; | ||||
|  | @ -47,6 +46,7 @@ use OCA\Social\Model\ActivityPub\Object\Note; | |||
| use OCA\Social\Model\ActivityPub\Stream; | ||||
| use OCA\Social\Model\InstancePath; | ||||
| use OCA\Social\Model\StreamAction; | ||||
| use OCA\Social\Tools\Traits\TStringTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class LikeService | ||||
|  | @ -119,9 +119,9 @@ class LikeService { | |||
| 			throw new StreamNotFoundException('Stream is not a Note'); | ||||
| 		} | ||||
| 
 | ||||
| //		if (!$note->isPublic()) {
 | ||||
| //			throw new StreamNotFoundException('Stream is not Public');
 | ||||
| //		}
 | ||||
| 		//		if (!$note->isPublic()) {
 | ||||
| 		//			throw new StreamNotFoundException('Stream is not Public');
 | ||||
| 		//		}
 | ||||
| 
 | ||||
| 		$like->setObjectId($note->getId()); | ||||
| 		$this->assignInstance($like, $actor, $note); | ||||
|  | @ -200,11 +200,11 @@ class LikeService { | |||
| 	 * @param Stream $note | ||||
| 	 */ | ||||
| 	private function assignInstance(ACore $item, Person $actor, Stream $note) { | ||||
| //		$item->addInstancePath(
 | ||||
| //			new InstancePath(
 | ||||
| //				$actor->getFollowers(), InstancePath::TYPE_FOLLOWERS, InstancePath::PRIORITY_LOW
 | ||||
| //			)
 | ||||
| //		);
 | ||||
| 		//		$item->addInstancePath(
 | ||||
| 		//			new InstancePath(
 | ||||
| 		//				$actor->getFollowers(), InstancePath::TYPE_FOLLOWERS, InstancePath::PRIORITY_LOW
 | ||||
| 		//			)
 | ||||
| 		//		);
 | ||||
| 		$item->addInstancePath( | ||||
| 			new InstancePath( | ||||
| 				$note->getAttributedTo(), InstancePath::TYPE_INBOX, InstancePath::PRIORITY_LOW | ||||
|  |  | |||
|  | @ -30,12 +30,6 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Exceptions\MalformedArrayException; | ||||
| use OCA\Social\Tools\Exceptions\RequestContentException; | ||||
| use OCA\Social\Tools\Exceptions\RequestNetworkException; | ||||
| use OCA\Social\Tools\Exceptions\RequestResultNotJsonException; | ||||
| use OCA\Social\Tools\Exceptions\RequestResultSizeException; | ||||
| use OCA\Social\Tools\Exceptions\RequestServerException; | ||||
| use Exception; | ||||
| use OCA\Social\AP; | ||||
| use OCA\Social\Exceptions\CacheContentMimeTypeException; | ||||
|  | @ -51,6 +45,12 @@ use OCA\Social\Model\ActivityPub\ACore; | |||
| use OCA\Social\Model\ActivityPub\Object\Document; | ||||
| use OCA\Social\Model\ActivityPub\Object\Note; | ||||
| use OCA\Social\Model\Post; | ||||
| use OCA\Social\Tools\Exceptions\MalformedArrayException; | ||||
| use OCA\Social\Tools\Exceptions\RequestContentException; | ||||
| use OCA\Social\Tools\Exceptions\RequestNetworkException; | ||||
| use OCA\Social\Tools\Exceptions\RequestResultNotJsonException; | ||||
| use OCA\Social\Tools\Exceptions\RequestResultSizeException; | ||||
| use OCA\Social\Tools\Exceptions\RequestServerException; | ||||
| use OCP\Files\NotFoundException; | ||||
| use OCP\Files\NotPermittedException; | ||||
| use Psr\Log\LoggerInterface; | ||||
|  | @ -112,7 +112,7 @@ class PostService { | |||
| 		$this->streamService->replyTo($note, $post->getReplyTo()); | ||||
| 		$this->streamService->addRecipients($note, $post->getType(), $post->getTo()); | ||||
| 		$this->streamService->addHashtags($note, $post->getHashtags()); | ||||
| //		$this->streamService->addAttachments($note, $post->getDocuments());
 | ||||
| 		//		$this->streamService->addAttachments($note, $post->getDocuments());
 | ||||
| 
 | ||||
| 		$token = $this->activityService->createActivity($actor, $note, $activity); | ||||
| 		$this->accountService->cacheLocalActorDetailCount($actor); | ||||
|  |  | |||
|  | @ -31,12 +31,12 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TAsync; | ||||
| use OC; | ||||
| //use OC\Push\Model\Helper\PushCallback;
 | ||||
| use OCA\Social\Exceptions\SocialAppConfigException; | ||||
| //use OC\Push\Model\Helper\PushCallback;
 | ||||
| use OCA\Social\Exceptions\StreamNotFoundException; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Person; | ||||
| use OCA\Social\Tools\Traits\TAsync; | ||||
| use OCP\AppFramework\QueryException; | ||||
| 
 | ||||
| //use OCP\Push\Exceptions\PushInstallException;
 | ||||
|  | @ -68,13 +68,13 @@ class PushService { | |||
| 		$this->miscService = $miscService; | ||||
| 
 | ||||
| 		// FIX ME: nc18/push
 | ||||
| //		if ($this->miscService->getNcVersion() >= 19) {
 | ||||
| //			try {
 | ||||
| //				$this->pushManager = OC::$server->query(IPushManager::class);
 | ||||
| //			} catch (QueryException $e) {
 | ||||
| //				$miscService->log('QueryException while loading IPushManager - ' . $e->getMessage());
 | ||||
| //			}
 | ||||
| //		}
 | ||||
| 		//		if ($this->miscService->getNcVersion() >= 19) {
 | ||||
| 		//			try {
 | ||||
| 		//				$this->pushManager = OC::$server->query(IPushManager::class);
 | ||||
| 		//			} catch (QueryException $e) {
 | ||||
| 		//				$miscService->log('QueryException while loading IPushManager - ' . $e->getMessage());
 | ||||
| 		//			}
 | ||||
| 		//		}
 | ||||
| 	} | ||||
| 
 | ||||
| 
 | ||||
|  | @ -83,50 +83,50 @@ class PushService { | |||
| 	 */ | ||||
| 	public function onNewStream(string $streamId) { | ||||
| 		return; | ||||
| //		if ($this->miscService->getNcVersion() < 19) {
 | ||||
| //			return;
 | ||||
| //		}
 | ||||
| //
 | ||||
| //		if (!$this->pushManager->isAvailable()) {
 | ||||
| //			return;
 | ||||
| //		}
 | ||||
| //
 | ||||
| //		try {
 | ||||
| //			$stream = $this->streamService->getStreamById($streamId);
 | ||||
| //		} catch (StreamNotFoundException $e) {
 | ||||
| //			return;
 | ||||
| //		}
 | ||||
| //
 | ||||
| //		try {
 | ||||
| //			$pushHelper = $this->pushManager->getPushHelper();
 | ||||
| //			$details = $this->detailsService->generateDetailsFromStream($stream);
 | ||||
| //		} catch (PushInstallException $e) {
 | ||||
| //			return;
 | ||||
| //		} catch (SocialAppConfigException $e) {
 | ||||
| //			return;
 | ||||
| //		}
 | ||||
| //
 | ||||
| //		$home = array_map(
 | ||||
| //			function(Person $item): string {
 | ||||
| //				return $item->getUserId();
 | ||||
| //			}, $details->getHomeViewers()
 | ||||
| //		);
 | ||||
| //
 | ||||
| //		$callback = new PushCallback('social', 'timeline.home');
 | ||||
| //		$callback->setPayloadSerializable($stream);
 | ||||
| //		$callback->addUsers($home);
 | ||||
| //		$pushHelper->toCallback($callback);
 | ||||
| //
 | ||||
| //		$direct = array_map(
 | ||||
| //			function(Person $item): string {
 | ||||
| //				return $item->getUserId();
 | ||||
| //			}, $details->getDirectViewers()
 | ||||
| //		);
 | ||||
| //
 | ||||
| //		$callback = new PushCallback('social', 'timeline.direct');
 | ||||
| //		$callback->addUsers($direct);
 | ||||
| //		$callback->setPayloadSerializable($stream);
 | ||||
| //		$pushHelper->toCallback($callback);
 | ||||
| 		//		if ($this->miscService->getNcVersion() < 19) {
 | ||||
| 		//			return;
 | ||||
| 		//		}
 | ||||
| 		//
 | ||||
| 		//		if (!$this->pushManager->isAvailable()) {
 | ||||
| 		//			return;
 | ||||
| 		//		}
 | ||||
| 		//
 | ||||
| 		//		try {
 | ||||
| 		//			$stream = $this->streamService->getStreamById($streamId);
 | ||||
| 		//		} catch (StreamNotFoundException $e) {
 | ||||
| 		//			return;
 | ||||
| 		//		}
 | ||||
| 		//
 | ||||
| 		//		try {
 | ||||
| 		//			$pushHelper = $this->pushManager->getPushHelper();
 | ||||
| 		//			$details = $this->detailsService->generateDetailsFromStream($stream);
 | ||||
| 		//		} catch (PushInstallException $e) {
 | ||||
| 		//			return;
 | ||||
| 		//		} catch (SocialAppConfigException $e) {
 | ||||
| 		//			return;
 | ||||
| 		//		}
 | ||||
| 		//
 | ||||
| 		//		$home = array_map(
 | ||||
| 		//			function(Person $item): string {
 | ||||
| 		//				return $item->getUserId();
 | ||||
| 		//			}, $details->getHomeViewers()
 | ||||
| 		//		);
 | ||||
| 		//
 | ||||
| 		//		$callback = new PushCallback('social', 'timeline.home');
 | ||||
| 		//		$callback->setPayloadSerializable($stream);
 | ||||
| 		//		$callback->addUsers($home);
 | ||||
| 		//		$pushHelper->toCallback($callback);
 | ||||
| 		//
 | ||||
| 		//		$direct = array_map(
 | ||||
| 		//			function(Person $item): string {
 | ||||
| 		//				return $item->getUserId();
 | ||||
| 		//			}, $details->getDirectViewers()
 | ||||
| 		//		);
 | ||||
| 		//
 | ||||
| 		//		$callback = new PushCallback('social', 'timeline.direct');
 | ||||
| 		//		$callback->addUsers($direct);
 | ||||
| 		//		$callback->setPayloadSerializable($stream);
 | ||||
| 		//		$pushHelper->toCallback($callback);
 | ||||
| 	} | ||||
| 
 | ||||
| //
 | ||||
|  |  | |||
|  | @ -31,7 +31,6 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use OCA\Social\Db\RequestQueueRequest; | ||||
| use OCA\Social\Exceptions\EmptyQueueException; | ||||
| use OCA\Social\Exceptions\NoHighPriorityRequestException; | ||||
|  | @ -39,6 +38,7 @@ use OCA\Social\Exceptions\QueueStatusException; | |||
| use OCA\Social\Model\ActivityPub\ACore; | ||||
| use OCA\Social\Model\InstancePath; | ||||
| use OCA\Social\Model\RequestQueue; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| class RequestQueueService { | ||||
| 	use TArrayTools; | ||||
|  |  | |||
|  | @ -30,28 +30,28 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Exceptions\MalformedArrayException; | ||||
| use OCA\Social\Tools\Model\Cache; | ||||
| use OCA\Social\Tools\Model\CacheItem; | ||||
| use OCA\Social\AP; | ||||
| use OCA\Social\Db\StreamRequest; | ||||
| use OCA\Social\Db\StreamQueueRequest; | ||||
| use OCA\Social\Db\StreamRequest; | ||||
| use OCA\Social\Exceptions\InvalidOriginException; | ||||
| use OCA\Social\Exceptions\InvalidResourceException; | ||||
| use OCA\Social\Exceptions\ItemUnknownException; | ||||
| use OCA\Social\Exceptions\StreamNotFoundException; | ||||
| use OCA\Social\Exceptions\QueueStatusException; | ||||
| use OCA\Social\Exceptions\RedundancyLimitException; | ||||
| use OCA\Social\Exceptions\SocialAppConfigException; | ||||
| use OCA\Social\Exceptions\StreamNotFoundException; | ||||
| use OCA\Social\Exceptions\UnauthorizedFediverseException; | ||||
| use OCA\Social\Model\ActivityPub\Object\Note; | ||||
| use OCA\Social\Model\ActivityPub\Stream; | ||||
| use OCA\Social\Model\StreamQueue; | ||||
| use OCA\Social\Tools\Exceptions\MalformedArrayException; | ||||
| use OCA\Social\Tools\Exceptions\RequestContentException; | ||||
| use OCA\Social\Tools\Exceptions\RequestNetworkException; | ||||
| use OCA\Social\Tools\Exceptions\RequestResultNotJsonException; | ||||
| use OCA\Social\Tools\Exceptions\RequestResultSizeException; | ||||
| use OCA\Social\Tools\Exceptions\RequestServerException; | ||||
| use OCA\Social\Exceptions\SocialAppConfigException; | ||||
| use OCA\Social\Exceptions\UnauthorizedFediverseException; | ||||
| use OCA\Social\Model\ActivityPub\Object\Note; | ||||
| use OCA\Social\Model\ActivityPub\Stream; | ||||
| use OCA\Social\Model\StreamQueue; | ||||
| use OCA\Social\Tools\Model\Cache; | ||||
| use OCA\Social\Tools\Model\CacheItem; | ||||
| 
 | ||||
| /** | ||||
|  * Class StreamQueueService | ||||
|  |  | |||
|  | @ -30,10 +30,6 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Service; | ||||
| 
 | ||||
| use OCA\Social\Tools\Exceptions\ArrayNotFoundException; | ||||
| use OCA\Social\Tools\Model\NCRequest; | ||||
| use OCA\Social\Tools\Model\SimpleDataStore; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use Exception; | ||||
| use OCA\Social\AP; | ||||
| use OCA\Social\Exceptions\HostMetaException; | ||||
|  | @ -42,6 +38,10 @@ use OCA\Social\Exceptions\InvalidResourceException; | |||
| use OCA\Social\Exceptions\ItemUnknownException; | ||||
| use OCA\Social\Model\ActivityPub\Actor\Person; | ||||
| use OCA\Social\Model\Test; | ||||
| use OCA\Social\Tools\Exceptions\ArrayNotFoundException; | ||||
| use OCA\Social\Tools\Model\NCRequest; | ||||
| use OCA\Social\Tools\Model\SimpleDataStore; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class TestService | ||||
|  |  | |||
|  | @ -31,15 +31,15 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Tools\Db; | ||||
| 
 | ||||
| use OCA\Social\Tools\Exceptions\DateTimeException; | ||||
| use OCA\Social\Tools\Exceptions\RowNotFoundException; | ||||
| use OCA\Social\Tools\IExtendedQueryBuilder; | ||||
| use OCA\Social\Tools\IQueryRow; | ||||
| use DateInterval; | ||||
| use DateTime; | ||||
| use Doctrine\DBAL\Query\QueryBuilder as DBALQueryBuilder; | ||||
| use Exception; | ||||
| use OC\DB\QueryBuilder\QueryBuilder; | ||||
| use OCA\Social\Tools\Exceptions\DateTimeException; | ||||
| use OCA\Social\Tools\Exceptions\RowNotFoundException; | ||||
| use OCA\Social\Tools\IExtendedQueryBuilder; | ||||
| use OCA\Social\Tools\IQueryRow; | ||||
| use OCP\DB\QueryBuilder\ICompositeExpression; | ||||
| use OCP\DB\QueryBuilder\IQueryBuilder; | ||||
| 
 | ||||
|  |  | |||
|  | @ -30,9 +30,9 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Tools\Model; | ||||
| 
 | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\Exceptions\CacheItemNotFoundException; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use JsonSerializable; | ||||
| 
 | ||||
| /** | ||||
|  * Class Cache | ||||
|  |  | |||
|  | @ -30,8 +30,8 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Tools\Model; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class CacheItem | ||||
|  |  | |||
|  | @ -31,8 +31,8 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Tools\Model; | ||||
| 
 | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| 
 | ||||
| /** | ||||
|  * Class Request | ||||
|  |  | |||
|  | @ -31,10 +31,10 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Tools\Model; | ||||
| 
 | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\Exceptions\ItemNotFoundException; | ||||
| use OCA\Social\Tools\Exceptions\MalformedArrayException; | ||||
| use OCA\Social\Tools\Traits\TArrayTools; | ||||
| use JsonSerializable; | ||||
| 
 | ||||
| /** | ||||
|  * Class SimpleDataStore | ||||
|  |  | |||
|  | @ -31,12 +31,12 @@ declare(strict_types=1); | |||
| 
 | ||||
| namespace OCA\Social\Tools\Traits; | ||||
| 
 | ||||
| use Exception; | ||||
| use JsonSerializable; | ||||
| use OCA\Social\Tools\Exceptions\ArrayNotFoundException; | ||||
| use OCA\Social\Tools\Exceptions\ItemNotFoundException; | ||||
| use OCA\Social\Tools\Exceptions\MalformedArrayException; | ||||
| use OCA\Social\Tools\Exceptions\UnknownTypeException; | ||||
| use Exception; | ||||
| use JsonSerializable; | ||||
| 
 | ||||
| /** | ||||
|  * Trait TArrayTools | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Maxence Lange
						Maxence Lange