migrate therinaldos.com data
Build & Deploy to DigitalOcean Space / build (push) Failing after 2m38s

This commit is contained in:
2024-05-05 15:50:45 -04:00
commit ef1ff240d4
23182 changed files with 3801898 additions and 0 deletions
@@ -0,0 +1,84 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class AddingCircleMemberEvent
*
* This event is called when one or multiple members are added to a Circle.
* This event is called on every instance of Nextcloud related to the Circle.
*
* The entry is already generated in the members table.
* The memberships of the member[s] are already generated in the memberships table.
*
* This is a good place if anything needs to be executed when a new member have been added to a Circle.
*
* If anything needs to be managed on the master instance of the Circle (ie. CircleMemberAddedEvent), please use:
* $event->getFederatedEvent()->setResultEntry(string $key, array $data);
*
* @package OCA\Circles\Events
*/
class AddingCircleMemberEvent extends CircleMemberGenericEvent {
/** @var int */
private $type = 0;
/**
* AddingCircleMemberEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
}
/**
* @param int $type
*
* @return $this
*/
public function setType(int $type): self {
$this->type = $type;
return $this;
}
/**
* @return int
*/
public function getType(): int {
return $this->type;
}
}
@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class CircleCreatedEvent
*
* This Event is called when it has been confirmed that the Circle have been created on all targeted
* instances.
* Targeted instance for this event are usually the one configured as GlobalScale.
*
* Meaning that the event won't be triggered until each instances have been once available during the
* retry-on-fail initiated in a background job
*
* WARNING: Unlike CreatingCircleEvent, this Event is only called on the master instance of the Circle.
*
* @package OCA\Circles\Events
*/
class CircleCreatedEvent extends CircleResultGenericEvent {
/**
* CircleCreatedEvent constructor.
*
* @param FederatedEvent $federatedEvent
* @param array $results
*/
public function __construct(FederatedEvent $federatedEvent, array $results) {
parent::__construct($federatedEvent, $results);
}
}
@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class CircleDestroyedEvent
*
* This Event is called when it has been confirmed that the Circle have been destroyed on all instances
* related to the Circle.
*
* Meaning that the event won't be triggered until each instances have been once available during the
* retry-on-fail initiated in a background job
*
* WARNING: Unlike DestroyingCircleEvent, this Event is only called on the master instance of the Circle.
*
* @package OCA\Circles\Events
*/
class CircleDestroyedEvent extends CircleResultGenericEvent {
/**
* CircleDestroyedEvent constructor.
*
* @param FederatedEvent $federatedEvent
* @param array $results
*/
public function __construct(FederatedEvent $federatedEvent, array $results) {
parent::__construct($federatedEvent, $results);
}
}
@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class CircleEditedEvent
*
* This Event is called when it has been confirmed that the Circle have been edited on all targeted
* instances.
*
* Meaning that the event won't be triggered until each instances have been once available during the
* retry-on-fail initiated in a background job
*
* WARNING: Unlike EditingCircleEvent, this Event is only called on the master instance of the Circle.
*
* @package OCA\Circles\Events
*/
class CircleEditedEvent extends CircleResultGenericEvent {
/**
* CircleEditedEvent constructor.
*
* @param FederatedEvent $federatedEvent
* @param array $results
*/
public function __construct(FederatedEvent $federatedEvent, array $results) {
parent::__construct($federatedEvent, $results);
}
}
@@ -0,0 +1,88 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Circle;
use OCA\Circles\Model\Federated\FederatedEvent;
use OCP\EventDispatcher\Event;
/**
* Class CircleMemberAddedEvent
*
* @package OCA\Circles\Events
*/
class CircleGenericEvent extends Event {
public const INVITED = 1;
public const JOINED = 2;
/** @deprecated */
public const MULTIPLE = 3;
public const REMOVED = 4;
public const LEFT = 5;
public const LEVEL = 6;
public const NAME = 7;
public const REQUESTED = 8;
/** @var FederatedEvent */
private $federatedEvent;
/** @var Circle */
private $circle;
/**
* CircleMemberAddedEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct();
$this->federatedEvent = $federatedEvent;
$this->circle = $federatedEvent->getCircle();
}
/**
* @return FederatedEvent
*/
public function getFederatedEvent(): FederatedEvent {
return $this->federatedEvent;
}
/**
* @return Circle
*/
public function getCircle(): Circle {
return $this->circle;
}
}
@@ -0,0 +1,81 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class CircleMemberAddedEvent
*
* This Event is called when it has been confirmed that a Member have been added on all instances used
* by the Circle.
* Meaning that the event won't be triggered until each instances have been once available during the
* retry-on-fail initiated in a background job
*
* WARNING: Unlike AddingCircleMemberEvent, this Event is only called on the master instance of the Circle.
*
* @package OCA\Circles\Events
*/
class CircleMemberAddedEvent extends CircleResultGenericEvent {
/** @var int */
private $type = 0;
/**
* CircleMemberAddedEvent constructor.
*
* @param FederatedEvent $federatedEvent
* @param array $results
*/
public function __construct(FederatedEvent $federatedEvent, array $results) {
parent::__construct($federatedEvent, $results);
}
/**
* @param int $type
*
* @return $this
*/
public function setType(int $type): self {
$this->type = $type;
return $this;
}
/**
* @return int
*/
public function getType(): int {
return $this->type;
}
}
@@ -0,0 +1,124 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class CircleMemberEditedEvent
*
* This Event is called when it has been confirmed that a Member have been edited on all instances used
* by the Circle.
* Meaning that the event won't be triggered until each instances have been once available during the
* retry-on-fail initiated in a background job
*
* WARNING: Unlike EditingCircleMemberEvent, this Event is only called on the master instance of the Circle.
*
* @package OCA\Circles\Events
*/
class CircleMemberEditedEvent extends CircleResultGenericEvent {
/** @var int */
private $type = 0;
/** @var int */
private $newLevel = 0;
/** @var string */
private $newDisplayName = '';
/**
* CircleMemberEditedEvent constructor.
*
* @param FederatedEvent $federatedEvent
* @param array $results
*/
public function __construct(FederatedEvent $federatedEvent, array $results) {
parent::__construct($federatedEvent, $results);
}
/**
* @param int $type
*
* @return $this
*/
public function setType(int $type): self {
$this->type = $type;
return $this;
}
/**
* @return int
*/
public function getType(): int {
return $this->type;
}
/**
* @param int $newLevel
*
* @return CircleMemberEditedEvent
*/
public function setNewLevel(int $newLevel): self {
$this->newLevel = $newLevel;
return $this;
}
/**
* @return int
*/
public function getNewLevel(): int {
return $this->newLevel;
}
/**
* @param string $newDisplayName
*
* @return CircleMemberEditedEvent
*/
public function setNewDisplayName(string $newDisplayName): self {
$this->newDisplayName = $newDisplayName;
return $this;
}
/**
* @return string
*/
public function getNewDisplayName(): string {
return $this->newDisplayName;
}
}
@@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
use OCA\Circles\Model\Member;
/**
* Class CircleMemberAddedEvent
*
* @package OCA\Circles\Events
*/
class CircleMemberGenericEvent extends CircleGenericEvent {
/** @var Member */
private $member;
/**
* CircleMemberAddedEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
$this->member = $federatedEvent->getMember();
}
/**
* @return Member
*/
public function getMember(): Member {
return $this->member;
}
}
@@ -0,0 +1,81 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class CircleMemberRemovedEvent
*
* This Event is called when it has been confirmed that a Member have been removed on all instances used
* by the Circle.
* Meaning that the event won't be triggered until each instances have been once available during the
* retry-on-fail initiated in a background job
*
* WARNING: Unlike RemovingCircleMemberEvent, this Event is only called on the master instance of the Circle.
*
* @package OCA\Circles\Events
*/
class CircleMemberRemovedEvent extends CircleResultGenericEvent {
/** @var int */
private $type = 0;
/**
* CircleMemberRemovedEvent constructor.
*
* @param FederatedEvent $federatedEvent
* @param array $results
*/
public function __construct(FederatedEvent $federatedEvent, array $results) {
parent::__construct($federatedEvent, $results);
}
/**
* @param int $type
*
* @return $this
*/
public function setType(int $type): self {
$this->type = $type;
return $this;
}
/**
* @return int
*/
public function getType(): int {
return $this->type;
}
}
@@ -0,0 +1,81 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class CircleMemberRequestedEvent
*
* This Event is called when it has been confirmed that a Member's request/invitation is done on all instances
* used by the Circle.
* Meaning that the event won't be triggered until each instances have been once available during the
* retry-on-fail initiated in a background job
*
* WARNING: Unlike RequestingCircleMemberEvent, this Event is only called on the master instance of the Circle.
*
* @package OCA\Circles\Events
*/
class CircleMemberRequestedEvent extends CircleResultGenericEvent {
/** @var int */
private $type = 0;
/**
* CircleMemberRequestedEvent constructor.
*
* @param FederatedEvent $federatedEvent
* @param array $results
*/
public function __construct(FederatedEvent $federatedEvent, array $results) {
parent::__construct($federatedEvent, $results);
}
/**
* @param int $type
*
* @return $this
*/
public function setType(int $type): self {
$this->type = $type;
return $this;
}
/**
* @return int
*/
public function getType(): int {
return $this->type;
}
}
@@ -0,0 +1,115 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Tools\Model\SimpleDataStore;
use OCA\Circles\Model\Circle;
use OCA\Circles\Model\Federated\FederatedEvent;
use OCA\Circles\Model\Member;
use OCP\EventDispatcher\Event;
/**
* Class CircleResultGenericEvent
*
* @package OCA\Circles\Events
*/
class CircleResultGenericEvent extends Event {
/** @var FederatedEvent */
private $federatedEvent;
/** @var SimpleDataStore[] */
private $results;
/** @var Circle */
private $circle;
/** @var Member */
private $member;
/**
* CircleResultGenericEvent constructor.
*
* @param FederatedEvent $federatedEvent
* @param SimpleDataStore[] $results
*/
public function __construct(FederatedEvent $federatedEvent, array $results) {
parent::__construct();
$this->federatedEvent = $federatedEvent;
$this->results = $results;
$this->circle = $federatedEvent->getCircle();
if ($federatedEvent->hasMember()) {
$this->member = $federatedEvent->getMember();
}
}
/**
* @return FederatedEvent
*/
public function getFederatedEvent(): FederatedEvent {
return $this->federatedEvent;
}
/**
* @return SimpleDataStore[]
*/
public function getResults(): array {
return $this->results;
}
/**
* @return Circle
*/
public function getCircle(): Circle {
return $this->circle;
}
/**
* @return bool
*/
public function hasMember(): bool {
return (!is_null($this->member));
}
/**
* @return Member|null
*/
public function getMember(): ?Member {
return $this->member;
}
}
@@ -0,0 +1,62 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class CreatingCircleEvent
*
* This event is called when a new Circle is created.
* This event is called on every targeted instance of Nextcloud.
* Targeted instance for this event are usually the one configured as GlobalScale.
*
* The entry is already generated in the circles table.
* The owner is already generated in the members table.
*
* This is a good place if anything needs to be executed when a new Circle has been created.
*
* If anything needs to be managed on the master instance of the Circle (ie. CircleCreatedEvent), please use:
* $event->getFederatedEvent()->setResultEntry(string $key, array $data);
*
* @package OCA\Circles\Events
*/
class CreatingCircleEvent extends CircleGenericEvent {
/**
* CreatingCircleEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
}
}
@@ -0,0 +1,62 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class DestroyingCircleEvent
*
* This event is called when a Circle is destroyed.
* This event is called on every instance of Nextcloud related to the Circle.
*
* The entry is already removed from the circles table.
* The members are already removed from the members table.
* The entries from the memberships table are already refreshed.
*
* This is a good place if anything needs to be executed when a Circle has been destroyed.
*
* If anything needs to be managed on the master instance of the Circle (ie. CircleDestroyedEvent), please use:
* $event->getFederatedEvent()->setResultEntry(string $key, array $data);
* *
* @package OCA\Circles\Events
*/
class DestroyingCircleEvent extends CircleGenericEvent {
/**
* DestroyingCircleEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
}
}
@@ -0,0 +1,61 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class EditingCircleEvent
*
* This event is called when a circle is edited.
* This event is called on every instance of Nextcloud related to the Circle.
*
* The entry is already edited in the circles table.
* If needed, the entries in the memberships table are already edited.
*
* This is a good place if anything needs to be executed when a circle is edited.
*
* If anything needs to be managed on the master instance of the Circle (ie. CircleEditedEvent), please use:
* $event->getFederatedEvent()->setResultEntry(string $key, array $data);
*
* @package OCA\Circles\Events
*/
class EditingCircleEvent extends CircleGenericEvent {
/**
* EditingCircleEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
}
}
@@ -0,0 +1,129 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class EditingCircleMemberEvent
*
* This event is called when a member is edited.
* This event is called on every instance of Nextcloud related to the Circle.
*
* The entry is already edited in the members table.
* If needed, the entries in the memberships table are already edited.
*
* This is a good place if anything needs to be executed when a member is edited.
*
* If anything needs to be managed on the master instance of the Circle (ie. CircleMemberEditedEvent), please
* use:
* $event->getFederatedEvent()->setResultEntry(string $key, array $data);
*
* @package OCA\Circles\Events
*/
class EditingCircleMemberEvent extends CircleMemberGenericEvent {
/** @var int */
private $type = 0;
/** @var int */
private $level = 0;
/** @var string */
private $displayName = '';
/**
* EditingCircleMemberEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
}
/**
* @param int $type
*
* @return $this
*/
public function setType(int $type): self {
$this->type = $type;
return $this;
}
/**
* @return int
*/
public function getType(): int {
return $this->type;
}
/**
* @param int $level
*
* @return EditingCircleMemberEvent
*/
public function setLevel(int $level): self {
$this->level = $level;
return $this;
}
/**
* @return int
*/
public function getLevel(): int {
return $this->level;
}
/**
* @param string $displayName
*
* @return EditingCircleMemberEvent
*/
public function setDisplayName(string $displayName): self {
$this->displayName = $displayName;
return $this;
}
/**
* @return string
*/
public function getDisplayName(): string {
return $this->displayName;
}
}
@@ -0,0 +1,79 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events\Files;
use OCA\Circles\Events\CircleGenericEvent;
use OCA\Circles\Model\Federated\FederatedEvent;
use OCA\Circles\Model\Mount;
/**
* Class CreatingFileShareEvent
*
* @package OCA\Circles\Events\Files
*/
class CreatingFileShareEvent extends CircleGenericEvent {
/** @var Mount */
private $mount;
/**
* CreatingFileShareEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
}
/**
* @param Mount $mount
*/
public function setMount(Mount $mount): void {
$this->mount = $mount;
}
/**
* @return Mount
*/
public function getMount(): Mount {
return $this->mount;
}
/**
* @return bool
*/
public function hasMount(): bool {
return !is_null($this->mount);
}
}
@@ -0,0 +1,53 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events\Files;
use OCA\Circles\Tools\Model\SimpleDataStore;
use OCA\Circles\Events\CircleResultGenericEvent;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class CreatingFileShareEvent
*
* @package OCA\Circles\Events\Files
*/
class FileShareCreatedEvent extends CircleResultGenericEvent {
/**
* FileShareCreatedEvent constructor.
*
* @param FederatedEvent $federatedEvent
* @param SimpleDataStore[] $result
*/
public function __construct(FederatedEvent $federatedEvent, array $result) {
parent::__construct($federatedEvent, $result);
}
}
@@ -0,0 +1,57 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events\Files;
use OCA\Circles\Events\CircleGenericEvent;
use OCA\Circles\Model\Federated\FederatedEvent;
use OCA\Circles\Model\Mount;
/**
* Class PreparingFileShareEvent
*
* @package OCA\Circles\Events\Files
*/
class PreparingFileShareEvent extends CircleGenericEvent {
/** @var Mount */
private $mount;
/**
* PreparingFileShareEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
}
}
@@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Membership;
use OCP\EventDispatcher\Event;
/**
* Class MembershipsCreatedEvent
*
* @package OCA\Circles\Events
*/
class MembershipsCreatedEvent extends Event {
/** @var Membership[] */
private $memberships;
/**
* MembershipsCreatedEvent constructor.
*
* @param Membership[] $memberships
*/
public function __construct(array $memberships) {
parent::__construct();
$this->memberships = $memberships;
}
/**
* @return Membership[]
*/
public function getMemberships(): array {
return $this->memberships;
}
}
@@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Membership;
use OCP\EventDispatcher\Event;
/**
* Class MembershipsEditedEvent
*
* @package OCA\Circles\Events
*/
class MembershipsEditedEvent extends Event {
/** @var Membership[] */
private $memberships;
/**
* MembershipsEditedEvent constructor.
*
* @param Membership[] $memberships
*/
public function __construct(array $memberships) {
parent::__construct();
$this->memberships = $memberships;
}
/**
* @return Membership[]
*/
public function getMemberships(): array {
return $this->memberships;
}
}
@@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Membership;
use OCP\EventDispatcher\Event;
/**
* Class MembershipsRemovedEvent
*
* @package OCA\Circles\Events
*/
class MembershipsRemovedEvent extends Event {
/** @var Membership[] */
private $memberships;
/**
* MembershipsRemovedEvent constructor.
*
* @param Membership[] $memberships
*/
public function __construct(array $memberships) {
parent::__construct();
$this->memberships = $memberships;
}
/**
* @return Membership[]
*/
public function getMemberships(): array {
return $this->memberships;
}
}
@@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class PreparingCircleMemberEvent
*
* This event is called when one or multiple members are added to a Circle.
*
* This event is called on the master instance of the circle, before AddingCircleMemberEvent.
*
* @package OCA\Circles\Events
*/
class PreparingCircleMemberEvent extends CircleMemberGenericEvent {
/**
* PreparingCircleMemberEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
}
}
@@ -0,0 +1,84 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class RemovingCircleMemberEvent
*
* This event is called when a member is removed from a Circle.
* This event is called on every instance of Nextcloud related to the Circle.
*
* The entry is already removed from the members table.
* The memberships of the member are already removed from the memberships table.
*
* This is a good place if anything needs to be executed when a member have been removed from a Circle.
*
* If anything needs to be managed on the master instance of the Circle (ie. CircleMemberRemovedEvent), please use:
* $event->getFederatedEvent()->setResultEntry(string $key, array $data);
*
* @package OCA\Circles\Events
*/
class RemovingCircleMemberEvent extends CircleMemberGenericEvent {
/** @var int */
private $type = 0;
/**
* RemovingCircleMemberEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
}
/**
* @param int $type
*
* @return $this
*/
public function setType(int $type): self {
$this->type = $type;
return $this;
}
/**
* @return int
*/
public function getType(): int {
return $this->type;
}
}
@@ -0,0 +1,83 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use OCA\Circles\Model\Federated\FederatedEvent;
/**
* Class RequestingCircleMemberEvent
*
* This event is called when one or multiple members are requesting/invited to a Circle.
* This event is called on every instance of Nextcloud related to the Circle.
*
* The entry is already generated in the members table.
*
* This is a good place if anything needs to be executed when a member requests or is invited to a Circle.
*
* If anything needs to be managed on the master instance of the Circle (ie. CircleMemberRequestedEvent), please use:
* $event->getFederatedEvent()->setResultEntry(string $key, array $data);
*
* @package OCA\Circles\Events
*/
class RequestingCircleMemberEvent extends CircleMemberGenericEvent {
/** @var int */
private $type = 0;
/**
* RequestingCircleMemberEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct($federatedEvent);
}
/**
* @param int $type
*
* @return $this
*/
public function setType(int $type): self {
$this->type = $type;
return $this;
}
/**
* @return int
*/
public function getType(): int {
return $this->type;
}
}
@@ -0,0 +1,119 @@
<?php
declare(strict_types=1);
/**
* Circles - Bring cloud-users closer together.
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Maxence Lange <maxence@artificial-owl.com>
* @copyright 2021
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace OCA\Circles\Events;
use JsonSerializable;
use OCA\Circles\Model\Circle;
use OCA\Circles\Model\Federated\FederatedEvent;
use OCP\EventDispatcher\Event;
/**
* Class CircleMemberAddedEvent
*
* @package OCA\Circles\Events
*/
class SharedItemsSyncRequestedEvent extends Event {
/** @var FederatedEvent */
private $federatedEvent;
/** @var Circle */
private $circle;
/** @var array */
private $sharedItems = [];
/**
* CircleMemberAddedEvent constructor.
*
* @param FederatedEvent $federatedEvent
*/
public function __construct(FederatedEvent $federatedEvent) {
parent::__construct();
$this->federatedEvent = $federatedEvent;
$this->circle = $federatedEvent->getCircle();
}
/**
* @return FederatedEvent
*/
public function getFederatedEvent(): FederatedEvent {
return $this->federatedEvent;
}
/**
* @return Circle
*/
public function getCircle(): Circle {
return $this->circle;
}
/**
* @param string $appId
* @param string $itemType
* @param JsonSerializable $item
*/
public function addSharedItem(string $appId, string $itemType, JsonSerializable $item): void {
$this->initArray($appId, $itemType);
$this->sharedItems[$appId][$itemType][] = $item;
}
/**
* @param string $appId
* @param string $source
* @param array $data
*/
public function addSharedArray(string $appId, string $source, array $data): void {
$this->initArray($appId, $source);
$this->sharedItems[$appId][$source][] = $data;
}
/**
* @param string $appId
* @param string $itemType
*/
private function initArray(string $appId, string $itemType) {
if (!is_array($this->sharedItems[$appId])) {
$this->sharedItems[$appId] = [];
}
if (!is_array($this->sharedItems[$appId][$itemType])) {
$this->sharedItems[$appId][$itemType] = [];
}
}
}