diff --git a/lib/Service/SubscriptionService.php b/lib/Service/SubscriptionService.php index 3dd770c..1d2b95a 100644 --- a/lib/Service/SubscriptionService.php +++ b/lib/Service/SubscriptionService.php @@ -43,14 +43,13 @@ class SubscriptionService { } } - public function create(string $userId, string $collectionName, string $transport, int $expirationTimestamp, $data, ?int $creationTimestamp = null) { + public function create(string $userId, string $collectionName, string $transport, int $expirationTimestamp, ?int $creationTimestamp = null) { $subscription = new Subscription(); $subscription->setUserId($userId); $subscription->setCollectionName($collectionName); $subscription->setTransport($transport); $subscription->setCreationTimestamp($creationTimestamp ?? time()); $subscription->setExpirationTimestamp($expirationTimestamp); - $subscription->setData(json_encode($data)); $subscription = $this->mapper->insert($subscription); return $subscription; diff --git a/lib/Transport/TransportManager.php b/lib/Transport/TransportManager.php index 712322e..bb8e2bf 100644 --- a/lib/Transport/TransportManager.php +++ b/lib/Transport/TransportManager.php @@ -27,18 +27,21 @@ declare(strict_types=1); namespace OCA\DavPush\Transport; use OCP\EventDispatcher\IEventDispatcher; +use OCP\Server; use OCA\DavPush\Events\RegisterTransportsEvent; use OCA\DavPush\PushTransports\WebPushTransport; -use OCA\DavPush\PushTransports\WebhookTransport; +//use OCA\DavPush\PushTransports\WebhookTransport; class TransportManager { private array $transports = []; - public function __construct(IEventDispatcher $dispatcher) { + public function __construct( + IEventDispatcher $dispatcher, + ) { // register integrated transports - $this->registerTransport(new WebPushTransport()); - $this->registerTransport(new WebhookTransport()); + $this->registerTransport(Server::get(WebPushTransport::class)); + //$this->registerTransport(ContainerInterface::get(WebhookTransport::class)); // register transports provided by other apps $event = new RegisterTransportsEvent($this);