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