kopia lustrzana https://github.com/nextcloud/social
Merge pull request #1138 from mnd/activitystream-vocabulary
Support all Actor types from Activity Vocabularypull/1150/head
commit
45a1f2138c
26
lib/AP.php
26
lib/AP.php
|
@ -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));
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -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';
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -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';
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -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';
|
||||
|
||||
|
||||
}
|
||||
|
Ładowanie…
Reference in New Issue