upstream V3 development https://www.gnusocial.rocks/v3
Go to file
Diogo Peralta Cordeiro 778cb57d83
[PLUGIN][ActivityPub] Finish base ActivityStreams 2.0 interface
Instructions below

To extend an Activity properties do:

public function onActivityPubValidateActivityStreamsTwoData(string $type_name, array &$validators): bool {
    if ($type_name === '{Type}') {
        $validators['attribute'] = myValidator::class;
    }
    return Event::next;
}

The Validator should be of the form:

use ActivityPhp\Type;
use ActivityPhp\Type\Util;
use Plugin\ActivityPub\Util\ModelValidator;

class myValidator extends ModelValidator
{
    /**
     * Validate Attribute's value
     *
     * @param mixed $value from JSON's attribute
     * @param mixed $container A {Type}
     * @return bool
     * @throws Exception
     */
    public function validate($value, $container): bool
    {
        // Validate that container is a {Type}
        Util::subclassOf($container, Type\Extended\Object\{Type}::class, true);

        return {Validation Result};

To act on received activities do:

public function onActivityPubNew{Type}(&$obj): bool {

To add information to Activities being federated by ActivityPub do:

public function ActivityPubAddActivityStreamsTwoData(string $type_name, &$type): bool {

To implement an ActivityStreams 2.0 representation do:

public function onActivityPubActivityStreamsTwoResponse(string $route, arrray $vars, ?TypeResponse &$response = null): bool {
        if ($route === '{Object route}') {
                $response = ModelResponse::handle($vars[{Object}]);
                return Event::stop;
        }
        return Event::next;
}
2021-12-04 21:05:07 +00:00
bin [UI][CONTROLLER][ENTITY][DOCS] Refactor term 'timeline' into 'feed' 2021-11-26 13:05:23 +00:00
components [COMPONENT][Link] Fix some minor issues with empty headed links, typo in event handler's name, and refactor entity to inside component 2021-12-03 00:46:52 +00:00
config [CORE][SECURITY] Move to the new authentication format, for Symfony 5.3 2021-11-25 20:37:45 +00:00
docker [DOCKER][Accessibility] Add pa11y docker image for automated accessibility tests 2021-12-01 20:29:06 +00:00
docs [Attachment] Move Controller and Entities to a Component 2021-12-02 15:14:07 +00:00
DOCUMENTATION [UI][CONTROLLER][ENTITY][DOCS] Refactor term 'timeline' into 'feed' 2021-11-26 13:05:23 +00:00
extlib [TOOLS][CS-FIXER] Run new PHP CS Fixer config. Notably, adds strict_types 2021-10-27 04:19:28 +01:00
plugins [PLUGIN][ActivityPub] Finish base ActivityStreams 2.0 interface 2021-12-04 21:05:07 +00:00
public [CSS] Note content text decoration underline set on anchor links 2021-12-03 01:19:09 +00:00
scripts [TOOLS][CS-FIXER] Run new PHP CS Fixer config. Notably, adds strict_types 2021-10-27 04:19:28 +01:00
src [CONTROLLER][UserPanel] Re-organised all settings forms. Added email, password, language forms separated from account or personal account info 2021-12-03 03:32:43 +00:00
templates [CONTROLLER][UserPanel] Re-organised all settings forms. Added email, password, language forms separated from account or personal account info 2021-12-03 03:32:43 +00:00
tests [COMPONENT][Link] Fix some minor issues with empty headed links, typo in event handler's name, and refactor entity to inside component 2021-12-03 00:46:52 +00:00
translations [I18N] Remove incomplete autogenerated translation file, to be fixed later 2021-09-14 13:05:42 +01:00
.dir-locals.el [TOOLS][PHPStan] Make a standalone phpstan executable, which executes inside the docker container 2021-10-27 04:19:31 +01:00
.env [QUEUE] Add queueing wrapper, default configuration and example usage 2021-09-14 13:05:33 +01:00
.env.test [TOOLS][TESTS] Adjust configuration for testing environment 2021-09-14 13:12:59 +01:00
.gitignore [TOOLS] Update PHP CS fixer and adjust configuration 2021-10-27 04:19:27 +01:00
.php-cs-fixer.php [TOOLS][CS-FIXER] Fix incorrect transformation 2021-10-27 04:19:28 +01:00
composer.json [DEPENDENCIES] Update symfony to 5.3, which fixes a bug with the doctrine postgres message worker 2021-11-15 19:25:53 +00:00
composer.lock [PLUGIN][ActivityPub] Finish base ActivityStreams 2.0 interface 2021-12-04 21:05:07 +00:00
CREDITS.md [DOCUMENTATION] Document All The Things! 2021-09-14 13:04:33 +01:00
docker-compose.yaml.default [TOOLS][DOCKER] Add worker container and script, which handles the queues 2021-11-15 19:25:53 +00:00
INSTALL.md [DOCUMENTATION] Add documentation on installing with Docker 2021-09-14 13:10:21 +01:00
Makefile [DOCKER][Accessibility] Add pa11y docker image for automated accessibility tests 2021-12-01 20:29:06 +00:00
phpstan.neon [TOOLS][COMPONENT][FreeNetwork][PLUGIN][ActivityPub] Temporarily exclude FreeNetwork and ActivityPub from PHPStan analysis, since it's a WIP 2021-11-25 20:37:53 +00:00
phpunit.xml.dist [TOOLS] Exclude src/PHPStan from test coverage 2021-11-25 20:37:53 +00:00
social.yaml [CONFIGURATION] Add webp to attachments:supported whitelist 2021-12-03 03:32:43 +00:00
symfony.lock [PLUGIN][ActivityPub] Finish base ActivityStreams 2.0 interface 2021-12-04 21:05:07 +00:00