diff --git a/.github/workflows/phpunit-mysql.yml b/.github/workflows/phpunit-mysql.yml
index 762865ab..bf3aaa5c 100644
--- a/.github/workflows/phpunit-mysql.yml
+++ b/.github/workflows/phpunit-mysql.yml
@@ -40,9 +40,6 @@ jobs:
matrix:
php-versions: ['8.0', '8.1']
server-versions: ['master']
- include:
- - php-versions: '7.4'
- server-versions: 'stable25'
services:
mysql:
diff --git a/.github/workflows/psalm-matrix.yml b/.github/workflows/psalm-matrix.yml
index 1bb33f3b..bd53ca59 100644
--- a/.github/workflows/psalm-matrix.yml
+++ b/.github/workflows/psalm-matrix.yml
@@ -24,7 +24,7 @@ jobs:
# do not stop on another job's failure
fail-fast: false
matrix:
- ocp-version: [ 'dev-master', 'dev-stable25' ]
+ ocp-version: [ 'dev-master', 'dev-stable27' ]
name: Nextcloud ${{ matrix.ocp-version }}
steps:
diff --git a/Makefile b/Makefile
index 142733d8..5cdb2ec0 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ package_name=$(app_name)
cert_dir=$(HOME)/.nextcloud/certificates
github_account=nextcloud
branch=master
-version+=0.6.0-rc3
+version+=0.6.0
all: dev-setup lint build-js-production composer
diff --git a/appinfo/info.xml b/appinfo/info.xml
index bcfaaa9e..ea95835c 100644
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -18,7 +18,7 @@
**🕸 Open standards:** We use the established ActivityPub standard!
]]>
- 0.6.0-rc3
+ 0.6.0
agpl
Maxence Lange
Julius Härtl
@@ -35,7 +35,7 @@
pgsql
sqlite
mysql
-
+
diff --git a/lib/AP.php b/lib/AP.php
index 226a63f7..bba34b9b 100644
--- a/lib/AP.php
+++ b/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;
diff --git a/lib/Command/CacheRefresh.php b/lib/Command/CacheRefresh.php
index 2629a566..d446c549 100644
--- a/lib/Command/CacheRefresh.php
+++ b/lib/Command/CacheRefresh.php
@@ -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');
diff --git a/lib/Command/CheckInstall.php b/lib/Command/CheckInstall.php
index d3396455..943a53b5 100644
--- a/lib/Command/CheckInstall.php
+++ b/lib/Command/CheckInstall.php
@@ -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;
}
diff --git a/lib/Controller/ActivityPubController.php b/lib/Controller/ActivityPubController.php
index 498a6261..64ba4112 100644
--- a/lib/Controller/ActivityPubController.php
+++ b/lib/Controller/ActivityPubController.php
@@ -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);
diff --git a/lib/Controller/ConfigController.php b/lib/Controller/ConfigController.php
index 82110048..141992bd 100644
--- a/lib/Controller/ConfigController.php
+++ b/lib/Controller/ConfigController.php
@@ -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;
diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php
index d0581885..863c4684 100644
--- a/lib/Controller/LocalController.php
+++ b/lib/Controller/LocalController.php
@@ -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;
diff --git a/lib/Controller/NavigationController.php b/lib/Controller/NavigationController.php
index 9323da47..0684a61a 100644
--- a/lib/Controller/NavigationController.php
+++ b/lib/Controller/NavigationController.php
@@ -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;
/**
diff --git a/lib/Controller/OStatusController.php b/lib/Controller/OStatusController.php
index c57cc8b3..195c6f72 100644
--- a/lib/Controller/OStatusController.php
+++ b/lib/Controller/OStatusController.php
@@ -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;
diff --git a/lib/Controller/QueueController.php b/lib/Controller/QueueController.php
index 3cf05d1b..82731f58 100644
--- a/lib/Controller/QueueController.php
+++ b/lib/Controller/QueueController.php
@@ -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;
diff --git a/lib/Controller/SocialPubController.php b/lib/Controller/SocialPubController.php
index 24634f8a..07278909 100644
--- a/lib/Controller/SocialPubController.php
+++ b/lib/Controller/SocialPubController.php
@@ -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;
diff --git a/lib/Cron/Cache.php b/lib/Cron/Cache.php
index 9a93565c..3f64043f 100644
--- a/lib/Cron/Cache.php
+++ b/lib/Cron/Cache.php
@@ -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) {
}
diff --git a/lib/Cron/Queue.php b/lib/Cron/Queue.php
index dabba1c3..dd933d16 100644
--- a/lib/Cron/Queue.php
+++ b/lib/Cron/Queue.php
@@ -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
diff --git a/lib/Dashboard/SocialWidget.php b/lib/Dashboard/SocialWidget.php
index fa5193d3..ad5395b9 100644
--- a/lib/Dashboard/SocialWidget.php
+++ b/lib/Dashboard/SocialWidget.php
@@ -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;
diff --git a/lib/Db/ActorsRequestBuilder.php b/lib/Db/ActorsRequestBuilder.php
index 851dfaf2..8682de60 100644
--- a/lib/Db/ActorsRequestBuilder.php
+++ b/lib/Db/ActorsRequestBuilder.php
@@ -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;
diff --git a/lib/Db/CacheDocumentsRequestBuilder.php b/lib/Db/CacheDocumentsRequestBuilder.php
index 546f5a94..27bd3c2e 100644
--- a/lib/Db/CacheDocumentsRequestBuilder.php
+++ b/lib/Db/CacheDocumentsRequestBuilder.php
@@ -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;
diff --git a/lib/Db/ClientRequest.php b/lib/Db/ClientRequest.php
index 162caada..12855ac3 100644
--- a/lib/Db/ClientRequest.php
+++ b/lib/Db/ClientRequest.php
@@ -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;
/**
diff --git a/lib/Db/ClientRequestBuilder.php b/lib/Db/ClientRequestBuilder.php
index ec8b32b9..6960885f 100644
--- a/lib/Db/ClientRequestBuilder.php
+++ b/lib/Db/ClientRequestBuilder.php
@@ -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
diff --git a/lib/Db/CoreRequestBuilder.php b/lib/Db/CoreRequestBuilder.php
index 1aa010c8..da152dcc 100644
--- a/lib/Db/CoreRequestBuilder.php
+++ b/lib/Db/CoreRequestBuilder.php
@@ -1094,10 +1094,10 @@ class CoreRequestBuilder {
}
}
-// $action = new Action();
-// $action->importFromDatabase($new);
+ // $action = new Action();
+ // $action->importFromDatabase($new);
-// return $action;
+ // return $action;
}
diff --git a/lib/Db/FollowsRequestBuilder.php b/lib/Db/FollowsRequestBuilder.php
index b59ae49d..286a06c4 100644
--- a/lib/Db/FollowsRequestBuilder.php
+++ b/lib/Db/FollowsRequestBuilder.php
@@ -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
diff --git a/lib/Db/HashtagsRequest.php b/lib/Db/HashtagsRequest.php
index 06cb3aae..e1148627 100644
--- a/lib/Db/HashtagsRequest.php
+++ b/lib/Db/HashtagsRequest.php
@@ -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
diff --git a/lib/Db/InstancesRequest.php b/lib/Db/InstancesRequest.php
index 55299dfd..7e02162b 100644
--- a/lib/Db/InstancesRequest.php
+++ b/lib/Db/InstancesRequest.php
@@ -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()))
diff --git a/lib/Db/RequestQueueRequestBuilder.php b/lib/Db/RequestQueueRequestBuilder.php
index a0731ada..341c20ed 100644
--- a/lib/Db/RequestQueueRequestBuilder.php
+++ b/lib/Db/RequestQueueRequestBuilder.php
@@ -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;
diff --git a/lib/Db/SocialCoreQueryBuilder.php b/lib/Db/SocialCoreQueryBuilder.php
index 49b2e1d3..4482849d 100644
--- a/lib/Db/SocialCoreQueryBuilder.php
+++ b/lib/Db/SocialCoreQueryBuilder.php
@@ -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;
diff --git a/lib/Db/SocialFiltersQueryBuilder.php b/lib/Db/SocialFiltersQueryBuilder.php
index 587605cf..ab1e6928 100644
--- a/lib/Db/SocialFiltersQueryBuilder.php
+++ b/lib/Db/SocialFiltersQueryBuilder.php
@@ -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);
diff --git a/lib/Db/SocialLimitsQueryBuilder.php b/lib/Db/SocialLimitsQueryBuilder.php
index 24bb37ac..283fffbb 100644
--- a/lib/Db/SocialLimitsQueryBuilder.php
+++ b/lib/Db/SocialLimitsQueryBuilder.php
@@ -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;
/**
diff --git a/lib/Db/StreamActionsRequestBuilder.php b/lib/Db/StreamActionsRequestBuilder.php
index ae5186ea..dc7159a0 100644
--- a/lib/Db/StreamActionsRequestBuilder.php
+++ b/lib/Db/StreamActionsRequestBuilder.php
@@ -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
diff --git a/lib/Db/StreamQueueRequestBuilder.php b/lib/Db/StreamQueueRequestBuilder.php
index 626c4466..0b372c11 100644
--- a/lib/Db/StreamQueueRequestBuilder.php
+++ b/lib/Db/StreamQueueRequestBuilder.php
@@ -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;
diff --git a/lib/Db/StreamRequestBuilder.php b/lib/Db/StreamRequestBuilder.php
index b2da2298..620c07c8 100644
--- a/lib/Db/StreamRequestBuilder.php
+++ b/lib/Db/StreamRequestBuilder.php
@@ -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();
diff --git a/lib/Db/StreamTagsRequest.php b/lib/Db/StreamTagsRequest.php
index 8cbe57c2..75145a0c 100644
--- a/lib/Db/StreamTagsRequest.php
+++ b/lib/Db/StreamTagsRequest.php
@@ -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;
/**
diff --git a/lib/Interfaces/Object/AnnounceInterface.php b/lib/Interfaces/Object/AnnounceInterface.php
index c163a8d8..f3456206 100644
--- a/lib/Interfaces/Object/AnnounceInterface.php
+++ b/lib/Interfaces/Object/AnnounceInterface.php
@@ -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());
diff --git a/lib/Interfaces/Object/FollowInterface.php b/lib/Interfaces/Object/FollowInterface.php
index f831acd7..9e074a15 100644
--- a/lib/Interfaces/Object/FollowInterface.php
+++ b/lib/Interfaces/Object/FollowInterface.php
@@ -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(
diff --git a/lib/Interfaces/Object/LikeInterface.php b/lib/Interfaces/Object/LikeInterface.php
index 27039305..4066cb67 100644
--- a/lib/Interfaces/Object/LikeInterface.php
+++ b/lib/Interfaces/Object/LikeInterface.php
@@ -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())
diff --git a/lib/Model/ActivityPub/ACore.php b/lib/Model/ActivityPub/ACore.php
index 7b950a69..da06209a 100644
--- a/lib/Model/ActivityPub/ACore.php
+++ b/lib/Model/ActivityPub/ACore.php
@@ -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;
}
diff --git a/lib/Model/ActivityPub/Internal/SocialAppNotification.php b/lib/Model/ActivityPub/Internal/SocialAppNotification.php
index ca1ccc15..530a1c60 100644
--- a/lib/Model/ActivityPub/Internal/SocialAppNotification.php
+++ b/lib/Model/ActivityPub/Internal/SocialAppNotification.php
@@ -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(),
diff --git a/lib/Model/ActivityPub/Object/Announce.php b/lib/Model/ActivityPub/Object/Announce.php
index eb568949..c139d41c 100644
--- a/lib/Model/ActivityPub/Object/Announce.php
+++ b/lib/Model/ActivityPub/Object/Announce.php
@@ -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());
}
/**
diff --git a/lib/Model/ActivityPub/Object/Follow.php b/lib/Model/ActivityPub/Object/Follow.php
index 00328785..8e77ac4b 100644
--- a/lib/Model/ActivityPub/Object/Follow.php
+++ b/lib/Model/ActivityPub/Object/Follow.php
@@ -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
diff --git a/lib/Model/ActivityPub/Stream.php b/lib/Model/ActivityPub/Stream.php
index 6ffc5a73..d4df8866 100644
--- a/lib/Model/ActivityPub/Stream.php
+++ b/lib/Model/ActivityPub/Stream.php
@@ -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;
diff --git a/lib/Model/Client/SocialClient.php b/lib/Model/Client/SocialClient.php
index c492dbcb..302c8173 100644
--- a/lib/Model/Client/SocialClient.php
+++ b/lib/Model/Client/SocialClient.php
@@ -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 = [];
/**
diff --git a/lib/Model/Instance.php b/lib/Model/Instance.php
index 02ffbda0..4dd29c7f 100644
--- a/lib/Model/Instance.php
+++ b/lib/Model/Instance.php
@@ -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;
}
diff --git a/lib/Model/InstancePath.php b/lib/Model/InstancePath.php
index 00fe6e65..ebcb1214 100644
--- a/lib/Model/InstancePath.php
+++ b/lib/Model/InstancePath.php
@@ -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
diff --git a/lib/Model/LinkedDataSignature.php b/lib/Model/LinkedDataSignature.php
index 15db77af..4387e29b 100644
--- a/lib/Model/LinkedDataSignature.php
+++ b/lib/Model/LinkedDataSignature.php
@@ -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 === []) {
diff --git a/lib/Model/RequestQueue.php b/lib/Model/RequestQueue.php
index 05fd4a15..b23d6985 100644
--- a/lib/Model/RequestQueue.php
+++ b/lib/Model/RequestQueue.php
@@ -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
diff --git a/lib/Model/StreamAction.php b/lib/Model/StreamAction.php
index 1b276dba..0018c74d 100644
--- a/lib/Model/StreamAction.php
+++ b/lib/Model/StreamAction.php
@@ -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
diff --git a/lib/Model/StreamDetails.php b/lib/Model/StreamDetails.php
index 78777b20..6d2cff1a 100644
--- a/lib/Model/StreamDetails.php
+++ b/lib/Model/StreamDetails.php
@@ -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
diff --git a/lib/Model/StreamQueue.php b/lib/Model/StreamQueue.php
index 91072ea1..77f1d61b 100644
--- a/lib/Model/StreamQueue.php
+++ b/lib/Model/StreamQueue.php
@@ -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
diff --git a/lib/Model/Test.php b/lib/Model/Test.php
index 1f331a02..ec933f4c 100644
--- a/lib/Model/Test.php
+++ b/lib/Model/Test.php
@@ -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
diff --git a/lib/Search/UnifiedSearchProvider.php b/lib/Search/UnifiedSearchProvider.php
index 5565f0c8..4089c992 100644
--- a/lib/Search/UnifiedSearchProvider.php
+++ b/lib/Search/UnifiedSearchProvider.php
@@ -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()
diff --git a/lib/Service/ActivityService.php b/lib/Service/ActivityService.php
index 793db770..1b8d1216 100644
--- a/lib/Service/ActivityService.php
+++ b/lib/Service/ActivityService.php
@@ -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);
diff --git a/lib/Service/ActorService.php b/lib/Service/ActorService.php
index 4123eeaf..17cad663 100644
--- a/lib/Service/ActorService.php
+++ b/lib/Service/ActorService.php
@@ -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
diff --git a/lib/Service/BoostService.php b/lib/Service/BoostService.php
index 3bbfbc3f..65011785 100644
--- a/lib/Service/BoostService.php
+++ b/lib/Service/BoostService.php
@@ -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);
diff --git a/lib/Service/CheckService.php b/lib/Service/CheckService.php
index 8439617c..d54c7b4b 100644
--- a/lib/Service/CheckService.php
+++ b/lib/Service/CheckService.php
@@ -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) {
diff --git a/lib/Service/ClientService.php b/lib/Service/ClientService.php
index e181cb41..264b63a3 100644
--- a/lib/Service/ClientService.php
+++ b/lib/Service/ClientService.php
@@ -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);
}
diff --git a/lib/Service/HashtagService.php b/lib/Service/HashtagService.php
index 0c00190e..daf21c1f 100644
--- a/lib/Service/HashtagService.php
+++ b/lib/Service/HashtagService.php
@@ -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;
diff --git a/lib/Service/ImportService.php b/lib/Service/ImportService.php
index ada48b27..9166e056 100644
--- a/lib/Service/ImportService.php
+++ b/lib/Service/ImportService.php
@@ -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;
diff --git a/lib/Service/InstanceService.php b/lib/Service/InstanceService.php
index 55305934..4c756253 100644
--- a/lib/Service/InstanceService.php
+++ b/lib/Service/InstanceService.php
@@ -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 {
diff --git a/lib/Service/LikeService.php b/lib/Service/LikeService.php
index b8f6ab34..17af145b 100644
--- a/lib/Service/LikeService.php
+++ b/lib/Service/LikeService.php
@@ -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
diff --git a/lib/Service/PostService.php b/lib/Service/PostService.php
index 96c28553..91ad482c 100644
--- a/lib/Service/PostService.php
+++ b/lib/Service/PostService.php
@@ -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);
diff --git a/lib/Service/PushService.php b/lib/Service/PushService.php
index 78274d5a..7f2bffe4 100644
--- a/lib/Service/PushService.php
+++ b/lib/Service/PushService.php
@@ -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);
}
//
diff --git a/lib/Service/RequestQueueService.php b/lib/Service/RequestQueueService.php
index e1e76272..e6106e18 100644
--- a/lib/Service/RequestQueueService.php
+++ b/lib/Service/RequestQueueService.php
@@ -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;
diff --git a/lib/Service/StreamQueueService.php b/lib/Service/StreamQueueService.php
index ae84a984..f274ce31 100644
--- a/lib/Service/StreamQueueService.php
+++ b/lib/Service/StreamQueueService.php
@@ -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
diff --git a/lib/Service/TestService.php b/lib/Service/TestService.php
index c099f76a..33eb858c 100644
--- a/lib/Service/TestService.php
+++ b/lib/Service/TestService.php
@@ -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
diff --git a/lib/Tools/Db/ExtendedQueryBuilder.php b/lib/Tools/Db/ExtendedQueryBuilder.php
index 77594207..50fcefbe 100644
--- a/lib/Tools/Db/ExtendedQueryBuilder.php
+++ b/lib/Tools/Db/ExtendedQueryBuilder.php
@@ -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;
diff --git a/lib/Tools/Model/Cache.php b/lib/Tools/Model/Cache.php
index 2a43a928..5d4abc2b 100644
--- a/lib/Tools/Model/Cache.php
+++ b/lib/Tools/Model/Cache.php
@@ -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
diff --git a/lib/Tools/Model/CacheItem.php b/lib/Tools/Model/CacheItem.php
index c462b60f..bb49258a 100644
--- a/lib/Tools/Model/CacheItem.php
+++ b/lib/Tools/Model/CacheItem.php
@@ -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
diff --git a/lib/Tools/Model/Request.php b/lib/Tools/Model/Request.php
index 58c76c76..af4c4533 100644
--- a/lib/Tools/Model/Request.php
+++ b/lib/Tools/Model/Request.php
@@ -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
diff --git a/lib/Tools/Model/SimpleDataStore.php b/lib/Tools/Model/SimpleDataStore.php
index a929756d..abe4e92d 100644
--- a/lib/Tools/Model/SimpleDataStore.php
+++ b/lib/Tools/Model/SimpleDataStore.php
@@ -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
diff --git a/lib/Tools/Traits/TArrayTools.php b/lib/Tools/Traits/TArrayTools.php
index e5e29419..07a38fc8 100644
--- a/lib/Tools/Traits/TArrayTools.php
+++ b/lib/Tools/Traits/TArrayTools.php
@@ -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