Support all Actor types from Activity Vocabulary

Support all types from https://www.w3.org/TR/2017/REC-activitystreams-vocabulary-20170523/

Signed-off-by: Nikolai Merinov <nikolai.merinov@member.fsf.org>
pull/1138/head
Nikolai Merinov 2020-11-23 01:50:16 -05:00
rodzic 2bbc2b7aac
commit 3722af564b
7 zmienionych plików z 310 dodań i 1 usunięć

Wyświetl plik

@ -47,6 +47,9 @@ use OCA\Social\Interfaces\Activity\UndoInterface;
use OCA\Social\Interfaces\Activity\UpdateInterface;
use OCA\Social\Interfaces\Actor\PersonInterface;
use OCA\Social\Interfaces\Actor\ServiceInterface;
use OCA\Social\Interfaces\Actor\GroupInterface;
use OCA\Social\Interfaces\Actor\OrganizationInterface;
use OCA\Social\Interfaces\Actor\ApplicationInterface;
use OCA\Social\Interfaces\IActivityPubInterface;
use OCA\Social\Interfaces\Internal\SocialAppNotificationInterface;
use OCA\Social\Interfaces\Object\AnnounceInterface;
@ -67,6 +70,9 @@ use OCA\Social\Model\ActivityPub\Activity\Undo;
use OCA\Social\Model\ActivityPub\Activity\Update;
use OCA\Social\Model\ActivityPub\Actor\Person;
use OCA\Social\Model\ActivityPub\Actor\Service;
use OCA\Social\Model\ActivityPub\Actor\Group;
use OCA\Social\Model\ActivityPub\Actor\Organization;
use OCA\Social\Model\ActivityPub\Actor\Application;
use OCA\Social\Model\ActivityPub\Internal\SocialAppNotification;
use OCA\Social\Model\ActivityPub\Object\Announce;
use OCA\Social\Model\ActivityPub\Object\Document;
@ -183,6 +189,9 @@ class AP {
$ap->notificationInterface = OC::$server->query(SocialAppNotificationInterface::class);
$ap->personInterface = OC::$server->query(PersonInterface::class);
$ap->serviceInterface = OC::$server->query(ServiceInterface::class);
$ap->groupInterface = OC::$server->query(GroupInterface::class);
$ap->groupInterface = OC::$server->query(OrganizationInterface::class);
$ap->groupInterface = OC::$server->query(ApplicationInterface::class);
$ap->rejectInterface = OC::$server->query(RejectInterface::class);
$ap->removeInterface = OC::$server->query(RemoveInterface::class);
$ap->undoInterface = OC::$server->query(UndoInterface::class);
@ -366,6 +375,18 @@ class AP {
$item = new Service();
break;
case Group::TYPE:
$item = new Group();
break;
case Organization::TYPE:
$item = new Organization();
break;
case Application::TYPE:
$item = new Application();
break;
case Tombstone::TYPE:
$item = new Tombstone();
break;
@ -496,7 +517,10 @@ class AP {
$types =
[
Person::TYPE,
Service::TYPE
Service::TYPE,
Group::TYPE,
Organization::TYPE,
Application::TYPE
];
return (in_array($item->getType(), $types));

Wyświetl plik

@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
/**
* Nextcloud - Social Support
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @copyright 2020, Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @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\Social\Interfaces\Actor;
use OCA\Social\Interfaces\IActivityPubInterface;
/**
* Class ApplicationInterface
*
* @package OCA\Social\Service\ActivityPub
*/
class ApplicationInterface extends PersonInterface implements IActivityPubInterface {
}

Wyświetl plik

@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
/**
* Nextcloud - Social Support
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @copyright 2020, Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @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\Social\Interfaces\Actor;
use OCA\Social\Interfaces\IActivityPubInterface;
/**
* Class GroupInterface
*
* @package OCA\Social\Service\ActivityPub
*/
class GroupInterface extends PersonInterface implements IActivityPubInterface {
}

Wyświetl plik

@ -0,0 +1,46 @@
<?php
declare(strict_types=1);
/**
* Nextcloud - Social Support
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @copyright 2020, Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @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\Social\Interfaces\Actor;
use OCA\Social\Interfaces\IActivityPubInterface;
/**
* Class OrganizationInterface
*
* @package OCA\Social\Service\ActivityPub
*/
class OrganizationInterface extends PersonInterface implements IActivityPubInterface {
}

Wyświetl plik

@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
/**
* Nextcloud - Social Support
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @copyright 2020, Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @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\Social\Model\ActivityPub\Actor;
use JsonSerializable;
/**
* Class Application
*
* @package OCA\Social\Model\ActivityPub
*/
class Application extends Person implements JsonSerializable {
const TYPE = 'Application';
}

Wyświetl plik

@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
/**
* Nextcloud - Social Support
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @copyright 2020, Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @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\Social\Model\ActivityPub\Actor;
use JsonSerializable;
/**
* Class Group
*
* @package OCA\Social\Model\ActivityPub
*/
class Group extends Person implements JsonSerializable {
const TYPE = 'Group';
}

Wyświetl plik

@ -0,0 +1,49 @@
<?php
declare(strict_types=1);
/**
* Nextcloud - Social Support
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @copyright 2020, Nikolai Merinov <nikolai.merinov@member.fsf.org>
* @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\Social\Model\ActivityPub\Actor;
use JsonSerializable;
/**
* Class Organization
*
* @package OCA\Social\Model\ActivityPub
*/
class Organization extends Person implements JsonSerializable {
const TYPE = 'Organization';
}