Compare commits

..

1 commit

12 changed files with 264 additions and 833 deletions

0
.gitignore vendored Executable file → Normal file
View file

View file

@ -1,48 +0,0 @@
This document describes what Event object implementations of existing services look like, how they differ and why and what could and should be improved.
## Gancio
```diff
{
"id": "https://gancio-test.event-federation.eu/federation/m/1",
"name": "Test Event",
"url": "https://gancio-test.event-federation.eu/event/test-event",
"type": "Event",
"startTime": "2024-01-18T12:10:00.000+01:00",
"endTime": "2024-01-18T18:30:00.000+01:00",
"location": {
"type": "Place"
"name": "Gmota",
"address": "Münzgragebenstraße 21, 8010 Graz",
"latitude": null,
"longitude": null
},
"attachment": [],
"tag": [],
"published": "2023-10-13T09:56:25.858Z",
"attributedTo": "https://gancio-test.event-federation.eu/federation/u/ganciofortesting",
"to": [
"https://www.w3.org/ns/activitystreams#Public"
],
"cc": [
"https://gancio-test.event-federation.eu/federation/u/ganciofortesting/followers"
],
- "content": "\n 📍 Gmota\n 📅 Thursday, 18 January (12:10)\n \n This is an awesome test event! Do not miss it!\n\n\n\nFor sure!\n",
+ "content": "This is an awesome test event! Do not miss it!\n\n\n\nFor sure!\n",
"summary": "\n 📍 Gmota\n 📅 Thursday, 18 January (12:10)\n \n This is an awesome test event! Do not miss it!\n\n\n\nFor sure!\n",
"@context": [
- "https://www.w3.org/ns/activitystreams"
+ "https://www.w3.org/ns/activitystreams",
+ {
+ "sc": "http://schema.org/",
+ "address": {
+ "@id": "sc:address",
+ "@type": "sc:Text"
+ },
+ }
]
}
```
The schema stuff got merged right ahead:
https://framagit.org/les/gancio/-/commit/9e1c2c2371e50dd1dbda32b92d5c45e4c0eb0900

View file

@ -1,243 +0,0 @@
---
gitea: none
title: WordPress/ActivityPub
authors:
- André Menrath
- ruruLanguageTool Linter
include_toc: true
---
This document outlines suggestions for the further development of the WordPress ActivityPub plugin regarding its interoperability with other WordPress plugins that could enhance ActivityPub functionality.
# Terms used
The following terms are used:
## Content related
- **post type:** post types and custom post types within WordPress
- **object type:** ActivityPub [object type](https://www.w3.org/TR/activitystreams-vocabulary/#object-types)
- **transformers:** a piece of code that converts items of particular WordPress post types to an ActivityPub object. For example a transformer that can transform:
- every post type to a `Note`
- `post` or `page` to `Note`, `Article`, `Image`, `Audio` or `Article` depending on the [post-format](https://wordpress.org/documentation/article/post-formats/)
- `tribe_events` (Event post the of [The Event Calendar](https://wordpress.org/plugins/the-events-calendar/)) to `Event`
- `podcast` (Podcast post of [Podlove Podcast Publisher](https://github.com/podlove/podlove-publisher)) to `PodcastEpisode` (as proposed and [implemented by Castopod](https://code.castopod.org/adaures/castopod/-/blob/main/app/Libraries/PodcastEpisode.php))
## Actor related
- **actors:** ActivityPub [Actor Objects](https://www.w3.org/TR/activitypub/#actor-objects)
- **actor types:** ActivityPub [Actor Types](https://www.w3.org/TR/activitystreams-vocabulary/#actor-types)
- **WordPress actor types:** Things on WordPress that can be mapped to actors, e.g.:
- WordPress users →`Person`
- Whole Blog →`Application` or `Group`
- Post types → e.g., `Organization`
- **Actor mapper:** Describes the mapping of WordPress actor types to any ActivityPub actors.
## General
- **publish/dispatch:** Sending a `Create`, `Update` or `Announce` [Activity](https://www.w3.org/TR/activitypub/#create-activity-outbox).
# Principals of the changes proposed to the ActivityPub plugin
The WordPress ActivityPub plugin
- should be aware (or even control) the whole chain from creating some content within WordPress to being published via ActivityPub. For sure, it should be the only plugin that directly sends and receives ActivityPub.
- should not get any more complex by default, the out-of-the box functionality/features and simplicity should be similar to version 1.0.0.
- offers other plugins the possibility to register custom transformers.
- (maybe) offers other plugins the possibility to register new WordPress actor types, e.g. the `tribe_organizer` post type of [The Event Calendar](https://wordpress.org/plugins/the-events-calendar/).
- handles the controls collisions of actor names:
* collisions that are already present during activation of a WordPress actor type on the settings page
* collisions that happen afterwards (e.g., a new user registering with the same username as the blog-wide actor)
* (maybe) show notifications/warnings when using an actor name which has been used and followed by in the past, as there may be issues due to caching of the old public key.
- maybe distinguishes between the default user interface and advanced sections which give the user more fine-grained control:
* transformer management
* actor management
# Goals
## Goals of the WordPress Event Federation project
The aim of the event federations project is to enable seamless federation of events created within an event plugin as an ActivityPub object with Type `Event` and accompanying meta-data, as typically seen in common ActivityPub implementations like Mobilizon. This will guarantee optimal compatibility between various services.
## Tangential Objectives:
Nevertheless, we see a lot of other cases that can benefit, if the primary goals of the Event Federation project are achieved this using a modularized approach as proposed below. The following list indicates examples what might be those other benefits:
- Other types of content get federated in a more feature rich way:
- `PodcastEpisode` [as proposed by CastoPod](https://code.castopod.org/adaures/castopod/-/blob/main/app/Libraries/PodcastEpisode.php)
- `Question`
- `Product`
- …
- ActivityPub offers features how to deal with multilingual content ([contentMap - see Example 115](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-contentmap)) which could be implemented differently by multilingual and translation plugins (example search for the current use of `->set_content_map` within the ActivityPub plugin).
**Note:** CastoPod, to give an example, has currently decided that podcast episodes will not be sent to followers as a `Create` activity directly containing the `PodcastEpisode` object, but will send a `Note` which is linking to the `PodcastEpisode`, because most Fediverse implementations currently ignore by default all object types they don't know. This is likely the same reason [flohmarkt](https://codeberg.org/grindhold/flohmarkt) is currently also using the `Note` and not `Product` even though that one would be available in the official specification.
# Transformer Management
## Current situation
### Frontend
The admin user interface in v1.0.0 lets one choose to which object type all post get transformed to. The options are:
* [x] Note (default) — Should work with most platforms.
* [ ] Article — The presentation of the "Article" might change on different platforms.
* [ ] WordPress Post-Format — Maps the WordPress Post-Format to the ActivityPub Object Type.
### Backend
Currently, all this functionality is handled via one hard-coded transformer in `includes/transformer/class post.php` ([Source](https://github.com/Automattic/wordpress-activitypub/blob/master/includes/transformer/class-post.php)) and the actual logic that assigns the type is somewhere else.
```php
/**
* WordPress Post Transformer
*
* The Post Transformer is responsible for transforming a WP_Post object into different othe
* Object-Types.
*
* Currently supported are:
*
* - Activitypub\Activity\Base_Object
*/
class Post {
...
/**
* Transforms the WP_Post object to an ActivityPub Object
*
* @see \Activitypub\Activity\Base_Object
*
* @return \Activitypub\Activity\Base_Object The ActivityPub Object
*/
public function to_object() {
...
```
## Proposal
All publicly accessible WordPress post types can become active for ActivityPub federation when selecting a transformer available for the relevant post type. **It is up to the transformer to determine the target ActivityPub object type**, which may vary depending on variables such as post type or post format. If there is no specific transformer available for a given post type, it cannot be assigned through the user interface.
### Frontend
| | Note | Post-Format | The Events Calendar Transformer | Custom Event Transformer |
| ----------------- |:----:|:-----------:|:-------------------------------:|:------------------------:|
| **post** | X | O | - | - |
| **page** | O | O | - | - |
| **tribe_events** | O | - | X | O |
| **custom_event** | O | - | - | O |
| **…** | O | - | - | - |
**columns:** Available transformers
**rows:** Public and non-password protected WordPress post types
**Note:** Only one or zero selections can be made in each row.
- For any custom post type, if there is a custom transformer registered, indicate that one should be selected as default (or select it right ahead?).
- Should not differ too much from the current view: Maybe completely hide the current activity object type part of the settings and only show the buttons for `enable` and `disable` and move the transformer table to an advanced settings page.
- Maybe make the tables more advanced and clearly show the origin of the transformer (built-in, etc.) and maybe a Pop-Up with a description, or even a link to a configuration page of the transformer.
### Backend
A solution could be to define a transformer interface and let the transformers be implementations.
```php
interface Transformer {
public function get_supported_post_types(): array;
public function get_transformer_info(): array;
public function to_object(WP_Post $post);
....
}
```
Use WordPress's hook system or a public API function to let other plugins register their custom transformer implementations to the ActivityPub plugin.
**Problem:** With the design above the transformer does a lot and leaves a lot of responsibility to the developer implementing it.
**Possible alternatives and solutions:**
- The ActivityPub plugin could provide reusable Traits for common tasks.
- Provide useful functions, documentation, and examples for automatic testing of transformers.
- Highly unlikely: The ActivityPub plugin provides an even more high level framework for adding transformers. For example for events the ActivityPub plugin could provide a built-in transformer to the object type `Event` which only needs a mapping (might make things harder, instead of making them easier). See Appendix.
- Highly unlikely: don't use an interface with implementations, (miss)use class extensions.
# Mapping: Actors and Dispatching (early draft)
More comprehensive actor management would benefit our project aims and potentially meet the needs of others in the future. Nevertheless, **its importance is considerably lower than that of Transformer management**. In the future, the following factors may become more important when larger websites should be using the ActivityPub plugin.
## Current situation
Currently, the admin user interface in v1.0.0 gives very limited options.
```
- [ ] Enable `blog`-actor
- [ ] Enable `author`-actors
```
Note that depending on which options are enabled, the method of federating via ActivityPub varies significantly:
- If the `blog`-actor is enabled, but the `author`-actors are not, posts are attributed and created by the blog actor.
- If both options are enabled the `blog`-actor will announce (boost) the posts of the `author`-actors.
Currently, the whole logic controlling this is written within the `Activity_Dispatcher` [class](https://github.com/Automattic/wordpress-activitypub/blob/master/includes/class-activity-dispatcher.php#L21) which is currently triggered only within the `Scheduler` [class](https://github.com/Automattic/wordpress-activitypub/blob/master/includes/class-scheduler.php#L14-L15).
Furthermore, although a blog actor is available, the ActivityPub plugin is still written in such a way that WordPress users are the default ActivityPub actors. This also reflects in things like the class which is responsible for the actor lookup is still called `Users` and yet handles the `Blog` and the `Application` user too, see the [Source](https://github.com/Automattic/wordpress-activitypub/blob/master/includes/collection/class-users.php).
## Possibilities
ActivityPub knows several [actor types](https://www.w3.org/TR/activitystreams-core/#actors):
- `Application`
- `Group`
- `Organization`
- `Person`
- `Service`
The ActivityPub specification allows for immense flexibility in its application. As WordPress websites fulfill a variety of tasks and objectives, it is **challenging to implement control features and options for actor management that are more capable without sacrificing user-friendliness.**
## What features does our Event Federation project need?
- For maximum Mobilizon compatibility we would love to have simply an actor of type `Application`, preferable called `@relay@wordpress.site`, that announces all events. Nonetheless, in theory, a Mobilizon instance should have the capability to follow any other actor as well. More or less this can already be achieved with the current blog-actor.
- Additionally, for example, organizers in [The Event Calendar](https://wordpress.org/plugins/the-events-calendar/) could also offer their own actor of type `Organizer` or `Group` to publicize events (getting referred to via [attributedTo](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attributedto)) if the `author`-actors are enabled, or create events (being the [actor](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-actor) directly) if the `author`-actors are not enabled.
- Optional: As events are sometimes published a long time before they start, adding the possibility that events get announced again at a scheduled time before the start, e.g. by sending an `Announce` activity.
## Other features
Other WordPress actor types might have valid use cases, like actors for categories, or specific post types in general: "I only want to see the blog updates, but I do not want to spam my timeline with each product they post on their website, even if they choose to federate them."
**Problems:**
- Overall complexity may lead to programming and usage errors.
- Naming collisions become more likely. See below.
- Who is the `actor`, who is the `attributedTo`, who is just sending an `Announce` of a post?
## Proposed starting point for evaluating use cases
We keep in mind that every post shall only ever be sent as a `Create` Activity once, by one single actor.
Therefore when the ActivityPub plugin makes use of a certain WordPress actor type, the WordPress actor type must exactly return one actor, which may depend on the current post being published and on the user doing the action (latter information should also be available within the WP_Post object).
**User Interface:**
| | User | Event organizers | Product Relay | Relay(Blog) | Categories |
| -----------------|:-----:|:----------------:|:-------------:|:------------:|:----------:|
| **post** | C | - | - | A | A |
| **page** | C | - | - | A | O |
| **tribe_events** | O | C | - | A | 0 |
| **product** | O | - | C | 0 | 0 |
**x:** Actor mapper
**y:** WordPress post types
**C:** `Create` — can only be assigned once per row
**A:** `Announce` — can be assigned multiple times per row, but only if a `Create` has been assigned before
- Only allow setting something to `Announce`, when a `Create` is already set.
- Maybe forbid, that a user can automatically announce a post, because it's the "lowest level".
## Actor collisions
Each ActivityPub actor must have a [unique ID](https://www.w3.org/TR/activitypub/#obj-id). In our case this is an HTTPS URI.
But in reality [webfinger](https://webfinger.net/) is used: `@actor-name@instance.tld`. Actors like Persons and Groups and Applications have public keys attached to them, as well as their ID is probably cached by most software. So assigning some actor-name to something new also can cause unintended behavior.
If multiple plugins want to individually federate their content (like events, products, and blog posts or even the built-in WordPress categories), they must be able to have something like an actor API, the ActivityPub plugin can register. The ActivityPub plugin being the main coordinator is necessary because actors are globally unique.
- For existing (collision was created before the installation/activation of the plugin)
- For new collisions (collision was/will be created after the installation/activation of the plugin)
It seems like it is the best if collisions are avoided in the first place by encouraging the use of prefixes, like `category_<category>`.
### Existing collisions
- **Easy:** Either we just tell the user to resolve all conflicts before a WordPress actor type can be activated at all
- **Complex:** We let him choose alternatives for conflicts.
### New collisions
- **Easy** Forbid the saving of new users or posts that would conflict with an existing actor.
- **Complex**
## Conclusion
- Anyway it seems the question has to be raised whether the ActivityPub plugin should store a history of all past and currently mapped actors.
- Additionally, shouldn't the user have a detailed overview in each case if the actor management should get more complex?
# Appendix
## The approach of youtube-dl
[youtube-dl](https://github.com/ytdl-org/youtube-dl) is solving a similar problem with "extractors" that return data to the processing-chain of youtube-dl. They provide a base class that includes useful functions for common issues e.g. automatic testing, geo-bypassing, login/cookie/header management. The most [basic extractor](https://github.com/ytdl-org/youtube-dl#adding-support-for-a-new-site) is about 40 lines of code.
They can also chain extractors recursively, like a extractor for mastodon videos, that gets the video from the post and returns the source of the video, that could be YouTube, Vimeo or anything else youtube-dl supports.

156
LICENSE
View file

@ -1,156 +0,0 @@
Creative Commons Attribution 4.0 International
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensors permission is not necessary for any reasonfor example, because of any applicable exception or limitation to copyrightthen that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
Section 1 Definitions.
a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
A. reproduce and Share the Licensed Material, in whole or in part; and
B. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
3. Term. The term of this Public License is specified in Section 6(a).
4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
5. Downstream recipients.
A. Offer from the Licensor Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
Section 3 License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified form), You must:
A. retain the following if it is supplied by the Licensor with the Licensed Material:
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
Section 4 Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
Section 5 Disclaimer of Warranties and Limitation of Liability.
a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 Term and Termination.
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
Creative Commons may be contacted at creativecommons.org.

View file

@ -1,26 +0,0 @@
# Add New Transformer
The WordPress ActivityPub plugin offers an advanced built-in transformer, but it also allows other plugins to register new transformers.
## Hooks
To do that we simply hook to the `activivitypub_transformer_register` action which provides access to the transformer manager as a parameter. Developers can use this manager to add new transformers using the `register()` method of this manager instance.
## Registering Transformers
To register new transformers use the following code:
```php
function register_new_transformers( $transformers_manager ) {
require_once( __DIR__ . '/activitypub/transformer/name-1.php' );
require_once( __DIR__ . '/activitypub/transformer/name-2.php' );
$transformers_manager->register( new \Transformer_1() );
$transformers_manager->register( new \Transformer_2() );
}
add_action( 'activivitypub_transformer_register', 'register_new_transformers' );
```
The transformer manager registers new transformers by accepting transformer instances. For more information about the transformer class, read about the [transformer class structure](./transformer-structure.md/).

View file

@ -1,23 +0,0 @@
# ActivityPub Transformers
The WordPress ActivityPub plugin comes with a built-in transformer which lets you choose how your posts will look like in the Fediverse.
## Managing Transformers
Other plugins can register new transformers and unregister existing ones.
* [Add New Transformer](./add-transformer.md/)
* [Remove Transformer](./remove-transformer.md/)
## Creating New Transformers
Learn more about transformer anatomy and how to create your own:
* [Transformer Structure](./transformer-structure.md/)
## Code Examples
See the following examples to see how easy it is.
* [The Events Calendar](./the-events-calendar-example.md/)

View file

@ -1,115 +0,0 @@
## Folder Structure
You need at least two files. One file for the transformer itself and one file for registering it.
```
activitypub-tribe-transformer/
|
├─ activitypub/
| └─ transformer/
| └─ tribe.php
|
└─ activitypub-tribe-transformer.php
```
## Plugin Files
**activitypub-tribe-transformer-php**
```php
<?php
/**
* Plugin Name: ActivityPub Transformer for The Events Calendar
* Description: Transforms tribe_event posts to ActivityPub object of type Event.
* Plugin URI: https://event-federation.eu/
* Version: 1.0.0
* Author: WordPress ActivityPub Enthusiast
* Author URI: https://event-federation.eu
* Text Domain: activitypub-tribe-transformer
*
* ActivityPub tested up to: 1.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Register Tribe Transformer.
*
* Include transformer file and register transformer class.
*
* @since 1.0.0
* @param \Activitypub\Transformer\Transformers_Manager $transformers_manager ActivtiyPub transformers manager.
* @return void
*/
function register_tribe_transformer( $transformers_manager ) {
require_once( __DIR__ . '/activitypub/transformer/tribe.php' );
$transformers_manager->register( new \Tribe() );
}
add_action( 'activitypub_transformers_register', 'register_tribe_transformer' );
```
**activtiypub/transformer/tribe.php**
```php
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* ActivityPub Tribe Transformer
*
* @since 1.0.0
*/
class Tribe extends \Activitypub\Transformer\Base {
/**
* Get transformer name.
*
* Retrieve the static and prefixed transformer name for this transformer.
*
* @since 1.0.0
* @access public
* @return string Widget name.
*/
public function get_name() {
return 'activitypub-tribe-transformer/tribe';
}
/**
* Get transformer title.
*
* Retrieve the transformer title.
*
* @since 1.0.0
* @access public
* @return string Widget title.
*/
public function get_label() {
return 'The Events Calendar';
}
/**
* Returns the ActivityStreams 2.0 Object-Type for an Event.
*
* @see https://www.w3.org/TR/activitystreams-vocabulary/#dfn-event
*
* @return string The Event Object-Type.
*/
protected function get_object_type() {
return 'Event';
}
/**
* Get supported post types.
*
* Retrieve the list of supported WordPress post types this transformer widget can handle.
*
* @since 1.0.0
* @access public
* @return array Widget categories.
*/
public function get_supported_post_types() {
return [ 'tribe_events' ];
}
}
```

View file

@ -1,38 +0,0 @@
# Transformer Structure
To create a custom ActivityPub Transformer start by creating a class that extends the `\Activitypub\Transformer\Base` class and fill in all the required methods.
Each transformer needs to have a few basic settings — a unique name that will identify the transformer, a label that will be used as the title when being displayed in the settings section, and a list of supported post types that the transformer can use as an input.
## Transformer Class
First, we need to create a class that extends the `\Activitypub\Transformer\Base` class:
```php
class Activitypub_Test_Transformer extends \Activitypub\Transformer\Base {
}
```
## Transformer Methods
A simple transformer skeleton class will look as follows:
```php
class Activitypub_Test_Transformer extends \Activitypub\Transformer\Base {
public function get_name() {}
public function get_label() {}
public function get_object_type() {}
public function supported_post_types() {}
public function to_object() {}
// TODO
}
```
The `\Activitypub\Transformer\Base` class has many more methods, but the vast majority of your needs are covered by the methods mentioned above.
// TODO

View file

@ -0,0 +1,264 @@
---
gitea: none
title: WordPress/ActivityPub
lang: en
authors:
- André Menrath
- ruru
include_toc: true
---
This document describes proposals for the evolvment of the [WordPress ActivityPub plugin](https://github.com/Automattic/WordPress-ActivityPub/) in the field of the interaction with other WordPress plugins that may add additional ActivityPub features.
# Terms used
The following terms are used:
## Actor related
- **Actors:** ActivityPub actors (https://www.w3.org/TR/activitypub/#actor-objects)
- **Actor Types:** ActivityPub [Actor Types](https://www.w3.org/TR/activitystreams-vocabulary/#actor types)
- **WordPress actor types:** Things on WordPress that can be mapped to actors:
- WordPress users
- Whole site/blog (relay)
- (custom) post-types
- **Mapping:** Which WordPress actor types are actually are mapped to any ActivityPub actors at all and to which one.
## Content related
- **post-type:** Post type and custom post types within WordPress
- **Object Type:** ActivityPub [Object-Type](https://www.w3.org/TR/activitystreams-vocabulary/#object-types)
- **Transformers:** a piece of code that transfers a WordPress-post of a specific WordPress-post-type to an ActivityPub object of a specific WordPress-object-type. For example a transformer that can transform:
- `post` to a `Note`
- `post` to a `Article`
- `post` to `Note`, `Article`, `Image`, `Audio` or `Article` depending on the [post-format](https://wordpress.org/documentation/article/post-formats/)
- `tribe_events` (Event post the of [The Event Calendar](https://wordpress.org/plugins/the-events-calendar/)) to `Event`
## General
- **publish:** Sending a `Create` or `Announce` [Activity](https://www.w3.org/TR/activitypub/#create-activity-outbox).
# Principals of the changes proposed to the ActivityPub plugin
The WordPress ActivityPub plugin
- should be aware (or even control) the whole chain from creating some content within WordPress to being published via ActivityPub. For sure, it should be the only plugin that directly sends and receives ActivityPub.
- should not get any more complex by default, the out-of-the box functionality/features and simplicity should be similar to version 1.0.0.
- offers other plugins the possibility to register custom transformers.
- offers other plugins the possibility to register new WordPress actor types, e.g. the `tribe_organizer` post type of [The Event Calendar](https://wordpress.org/plugins/the-events-calendar/).
- handles the controls collisions of actor names:
* collisions that are already present during activation of a WordPress actor type on the settings page
* collisions that happen afterwards (e.g. a new user registering with the same username as the blog-wide actor)
- maybe distinguishes between the default admin user interface and advanced sections which give the user more fine-grained control:
* transformer management
* actor management
# Goals
Our primary goal is to make it possible that events created within an event plugin can federate properly as an ActivityPub object with Type `Event` along with all the meta-data belonging to the event, as found in common ActivityPub implementations, e.g. of Mobilizon, in order to ensure maximum compatibly between those services.
Nevertheless, we see a lot of other cases that can benefit, if we achieve this using a modularized approach as proposed below. The following list indicates examples what might be those other benefits:
- Other types of content get federated in a more feature rich way:
- `PodcastEpisode` (as proposed by CastoPod)
- `Question` (as used by Mastodon)
- `Product`
- ...
- ActivityPub offers features how to deal with multilingual content ([contentMap - see Example 115](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-contentmap)) which could be implemented differently by multilingual and translation plugins (example search for the current use of `->set_content_map` within the ActivityPub plugin).
# Transformer Management
## User Interface
### Current situation
The admin user interface in v1.0.0 lets one choose to which object type all post get transformed to. The options are:
* [x] Note (default) - Should work with most platforms.
* [ ] Article - The presentation of the "Article" might change on different platforms.
* [ ] WordPress Post-Format - Maps the WordPress Post-Format to the ActivityPub Object Type.
### Proposal
Every public WordPress post type may be transformed (have different transformers available) to a different ActivityPub object types. Transformations that are not
available for a given post-type are greyed out.
| | Note | Article | Page | Event |
| ----------------- |:----:|:-------:|:----:|:-----:|
| **post** | X | O | O | - |
| **page** | O | X | O | - |
| **tribe_events** | O | - | - | X |
| **...** | O | - | - | - |
x: ActivityPub object-types, y: WordPress post-types
- For any custom post-type, if there is a custom transformer registered, indicate that one should be selected as default (or select it right ahead?).
- Should not differ too much from the current view: Maybe completely hide the current Activity-Object-Type part of the settings and only show the buttons for `enable` and `disable` and move the transformer table to an advanced settings page.
### Problems
- If two transformers with the same source and target are installed, then we have two possibilities:
1. A dropdown menu is displayed to select one of the transformers.
2. Adding another column and maybe add indicators where the transformer comes from (e.g. `builtin`, `custom` or showing the source)
- Should a transformer be always a many-to-one relationship or may it be a many-to-many one.
- Do we really want to manage which transformers apply to what directly or do users prefer a setting like "let a certain plugin take care of this post type"? Then further configuration would have to be managed by the other plugins.
## Backend
Currently, only one hard-coded transformer exists in [`includes/transformer/class-post.php`](https://github.com/Automattic/wordpress-activitypub/blob/master/includes/transformer/class-post.php).
```php
/**
* WordPress Post Transformer
*
* The Post Transformer is responsible for transforming a WP_Post object into different othe
* Object-Types.
*
* Currently supported are:
*
* - Activitypub\Activity\Base_Object
*/
class Post {
...
/**
* Transforms the WP_Post object to an ActivityPub Object
*
* @see \Activitypub\Activity\Base_Object
*
* @return \Activitypub\Activity\Base_Object The ActivityPub Object
*/
public function to_object() {
...
```
A solution could be to define a transformer interface and let the transformers be implementations.
```php
interface Transformer {
public function get_supported_post_types(): array;
public function get_target_activitypub_object_type(): string;
public function to_object(WP_Post $post);
....
}
```
Use WordPress's hook system or a public API function to let other plugins register their custom transformer implementations to the ActivityPub plugin.
### Problem
With the design above the transformer does a lot and leaves a lot of responsibility to the developer implementing it.
Possible alternatives and solutions:
- The ActivityPub plugin could provide reusable Traits for common tasks.
- The ActivityPub plugin provides an even more height level framework for adding transformers. For example for events the ActivityPub plugin could provide a built-in transformer to the object type `Event` which only needs a mapping (might make things harder, instead of making them easier). See Appendix.
- Don't use an interface with implementations, (miss)use class extensions.
# Actor Mapping Management
More comprehensive actor management would benefit our project aims and potentially meet the needs of others in the future. Nevertheless, **its importance is considerably lower than that of Transformer management**. In the future, the following factors may become more important when larger websites should be using the ActivityPub plugin.
Currently, the admin user interface in v1.0.0 gives very limited options.
```
- [ ] Enable `blog`-actor
- [ ] Enable `author`-actors
```
Note that depending on which options are enabled, the method of federating via ActivityPub varies significantly:
- If the `blog`-actor is enabled, but the `author`-actors are not, posts are attributed and created by the blog actor.
- If both are enabled the `blog`-actor will announce (boosting) the posts of the
`author`-actors.
## Possibilities
ActivityPub knows several [actor types](https://www.w3.org/TR/activitystreams-core/#actors):
- Application
- Group
- Organization
- Person
- Service
The specifications allow for a lot of flexibility in their use. As WordPress websites serve a variety of tasks and goals, providing more detailed capabilities and options in this area **may prove challenging to accomplish in a user-friendly manner**.
## What features does our event federation project need?
- For maximum Mobilizon compatibility we would love to have simply an actor of type `Application`, preferable called `@relay@wordpress.site`, that announces all events. Nonetheless, in theory, a Mobilizon instance should have the capability to follow any other actor as well.
- Additionally, for example, organizers in [The Event Calendar](https://wordpress.org/plugins/the-events-calendar/) could also offer their own actor of type `Organizer` or `Group` to publicize events, or create events if the `author`-actors are not enabled.
## Other features
Other WordPress actor types might have valid use cases, like actors for categories, or specific post types in general: "I only want to see the blog updates, but I do not want to spam my timeline with each product they post on their site, even if they choose to federate them."
### Problems
- Overall complexity may lead to programming and usage errors.
- Naming collisions become more likely.
- Who is the `actor`, who is the `attributedTo`, who is just sending an `Announce` of a post?
## Proposed starting point for evaluating use cases
We keep in mind that every post type shall only ever send as a `Create` Activity once by one single actor.
### User Interface
| | users | tribe_organizers | custom | blog | category |
| -----------------|:-----:|:----------------:|:------:|:-----:|:--------:|
| **post** | C | O | O | A | A |
| **page** | C | O | O | A | O |
| **tribe_events** | O | C | - | A | 0 |
| **product** | O | - | C | 0 | 0 |
**x:** WordPress actor-types
**y:** WordPress post-types
**C:** Create
**A:** Announce
**user:** the WordPress user publishing or updating something
**all:** blog-wide actor, everything that is published (like a relay)
**custom:** e.g. only a certain post_type that gets announced with this actor
**tribe_organizers:** only posts by one organizer
- Only allow setting something to `Announce`, when a `Create` is already set.
- Maybe forbid, that a user can automatically announce a post, because it's the "lowest level".
## Actor collisions
Each ActivityPub actor must have a [unique ID](https://www.w3.org/TR/activitypub/#obj-id). In our case this is a HTTPS URI.
But in reality [webfinger](https://webfinger.net/) is used: `@actor-name@instance.tld`. Actors like Persons and Groups and Applications have Public Keys attached to them, as well as their ID is probably cached by most software. So assigning some actor-name to something new also can cause unintended behavior.
If multiple plugins want to individually federate their content (like events, products and blog posts or even the built-in WordPress categories), they must be able to have something like an actor API, the ActivityPub plugin can register. The ActivityPub plugin being the main coordinator is necessary because actors are globally unique.
- For existing (collision was created before the installation/activation of the plugin)
- For new collisions (collision was/will be created after the installation/activation of the plugin)
It seems like it is the best if collisions are avoided in the first place by encouraging the use of prefixes, like `category_<category>`.
Anyway it seems the question has to be raised wheter activitypub should store a history of all past and currently mapped actors.
### Existing collisions
- **Easy:** Either we just tell the user to resolve all conflicts before a WordPress actor type can be activated at all
- **Complex:** We let him choose alternatives for conflicts.
### New collisions
- **Easy** Forbid the saving of new users or posts that would conflict with an existing actor.
- **Complex** ...
## Conclusion
- Anyway it seems the question has to be raised whether the ActivityPub plugin should store a history of all past and currently mapped actors.
- Additionally, shouldn't the user have a detailed overview in each case if the actor management should get more complex?
### Proposal of how plugins register WordPress-actor types
```php
interface ActorType {
public function getActorTypeName(); // returns name of the ActorType
public function listActorsOfThisType(); // returns array of actors of this type
public function listPostsForThisActor($actor); // returns array of posts
}
```
The registration of an actor type also registers every actor that is currently in the `listActorsOfThisType()`-list.
# Appendix
## The approach of youtube-dl
[youtube-dl](https://github.com/ytdl-org/youtube-dl) is solving a similar problem with "extractors" that return data to the processing-chain of youtube-dl. They provide a base class that includes useful functions for common issues e.g. automatic testing, geo-bypassing, login/cookie/header management.
They can also chain extractors recursivly, like a extractor for mastodon videos, that gets the video from the post and returns the source of the video, that could be youtube, vimeo or anything else youtube-dl supports.

View file

@ -1,132 +0,0 @@
---
gitea: none
include_toc: true
---
Status: draft. This document should be reviewed by the other main developers.
# Validation/Import of remote events
This document gives an overview how remote `Event` objects are treated by common Fediverse applications.
## Mastodon
**Last updated**: 2024-10-20
Mastodon does not have support or events, but an `Event` object is in the [list of converted object types](https://github.com/mastodon/mastodon/pull/12637/commits/0428c00e30abcb0580558f9bdca672abc8b68f81).
It neglets all event related fields but `title`, `summary` and `url` which it uses to create a Mastodon status (toot) representation of the event.
## Mobilizon
**Last uptaded**: 2024-01-20
**Information sources**:
- [Mobilizon ActivityStreams converter for Event](https://framagit.org/framasoft/mobilizon/-/blob/main/lib/federation/activity_stream/converter/event.ex?ref_type=heads)
- [Mobilizon Database schema for Event](https://framagit.org/framasoft/mobilizon/-/blob/main/lib/mobilizon/event.ex?ref_type=heads)
### Required
- [`attributedTo`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attributedTo) or [`actor`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-actor): Mobilizon uses actor for the user profile and attributedTo for the group. But as `actor` being part of an object is not part of the ActivityPub spec, solely using `attributedTo` might preferred if they are similar.
- `id`: This is also used for the `url`.
- [`name`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-name): The events title.
- [`startTime`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-startTime)
- [`to`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-to)
- [`type`]: must be `Event`
### Optional
- [`attachment`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attachment) How they are used
- [`anonymousparticipationenabled`](https://docs.joinmobilizon.org/contribute/activity_pub/#anonymousparticipationenabled)
- `category`: default list of categories can be found [in the source code](https://framagit.org/framasoft/mobilizon/-/blob/main/lib/mobilizon/events/categories.ex?ref_type=heads#L28), but it can be extended via environment variables. Note that the source code shows them in lowercase, but they have to be passed as uppercase, e.g. `MOVEMENTS_POLITICS`.
- [`commentsEnabled`](https://docs.joinpeertube.org/api/activitypub)
- `contacts`: a list of contacts: each item might be just the `id`/`url` or an `Actor` object.
- [`content`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-content): `contentMap` is currently not supported by Mobilizon.
- [`endTime`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-endTime)
- `externalParticipationUrl`: Only used if `joinMode` is set to `external`.
- `is_online`: Boolean indicating whether the Event is online.
- [`joinMode`](https://docs.joinmobilizon.org/contribute/activity_pub/#joinmode): `[free, restricted, invite, external]` default is `free`.
- [`location`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-location): The subkey [`address`](https://schema.org/address) is accepted, both as [`PostalAddress`](https://schema.org/PostalAddress) and pure text.
- [`maximumAttendeeCapacity`](https://docs.joinmobilizon.org/contribute/activity_pub/#maximumattendeecapacity)
- [`mentions`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-mentions)
- `metadata`: This is a list that can contain items. TODO.
- `participantCount`: [Not parsed at the moment](https://framagit.org/framasoft/mobilizon/-/issues/1412)
- [`repliesModerationOption`](https://docs.joinmobilizon.org/contribute/activity_pub/#repliesModerationOption)
- `remainingAttendeeCapacity`: [Not parsed at the moment](https://framagit.org/framasoft/mobilizon/-/issues/1412)
- [`tag`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-tag)
- `timezone`
- `url`: [Documentation](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-url) - Note: `url` was added to the list as it was referenced in the text but not explicitly listed in the initial set.
### Not used
- [`url`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-url): internally Mobilizon uses the `id` as URL.
### To Test:
### Handling of visibility, comments and discoverability
- If `https://www.w3.org/ns/activitystreams#Public` is not in `to` it will be treated as `unlisted`, else as `public`. This are the only options for remote events, even though internally Mobilizon supports `[public, unlisted, restricted, private]`.
- For comments to be enabled within Mobilizon either [`commentsEnabled`](https://docs.joinpeertube.org/api/activitypub) must be `true` or `repliesModerationOption` must be set to `allow_all`. `repliesModerationOption` is more important. If none is of both is passed replies will be disabled.
- When the `attributedTo` (or if `attributedTo` is not set, but `actor` is set) contains an `Actor` of type `Person` the remote `Event` will not be listed and searchable.
- If `timezone` is not defined Mobilizon might calculate the timezone via the `location`.
### Attachment/Banner-image handling
Mobilizon currently expects all images to by within `attachment` and to be an `Object` of type `Document`. It first looks for an object where the `name` is equal to `Banner`. If that is not found it uses ´attachment[0]`.
## Gancio
**Last uptaded**: 2024-01-20
### Required
- `id`: even though Gancio currently does not [list it as required in its source code](https://framagit.org/les/gancio/-/blob/master/server/federation/events.js?ref_type=heads#L19), there will be an error without out it.
- [`name`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-name): The events title.
- [`startTime`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-startTime)
### Optional
- [`attachment`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-attachment) Only the first one is used as a banner image, all others are ignored, see below.
- [`content`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-content) `contentMap` is currently not supported by Gancio.
- [`endTime`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-endTime)
- [`location`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-location): The subkey [`address`](https://schema.org/address) is accepted, both as [`PostalAddress`](https://schema.org/PostalAddress) and pure text. For `PostalAddress` only `streetAddress`, `addressLocality`, and `addressCountry` are used.
- [`summary`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-summary) The summary is only used when no content is supplied.
### Not used
- `attributedTo`/`actor`: Gancio does not support fetching event other than by receiving a `Create` or `Update` activity (TODO: what about `Announce`), the actor is always just fetched from the activity, not the object within.
### Handling of visibility
Currently Gancio does not seem to handle any visibility or replies-policy options. It sets all remote events it received to the internal `is_visible` to `true`.
### Banner image
Gancio takes the first `attachment` of the `Event` object as the banner image of the event. It optionally supports [`name`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-name) as the alternative text and [`focalPoint`](https://docs.joinmastodon.org/spec/activitypub/#focalPoint).
## Plemora
**Last uptaded**: 2024-01-20
**Information sources**: Plemora has a open [Pull Request towards Mobilizon compatible events](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3955/diffs) which Rebased (a fork of Plemora) has already merged.
### Required
This probably has a lot of errors still. [Source Code](https://git.pleroma.social/pleroma/pleroma/-/blob/b1a06c394736be833f8220a5ec3d5d2702d9519c/lib/pleroma/web/activity_pub/object_validators/event_validator.ex).
- `id`: even though Gancio currently does not [list it as required in its source code](https://framagit.org/les/gancio/-/blob/master/server/federation/events.js?ref_type=heads#L19), there will be an error without out it.
- [`name`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-name): The events title.
- [`startTime`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-startTime)
- [`endTime`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-endTime)
### Optional
- [`joinMode`](https://docs.joinmobilizon.org/contribute/activity_pub/#joinmode): `[free, restricted, invite, external]` default is `free`.
- [`location`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-location): The subkey [`address`](https://schema.org/address) is accepted, but currently ony as [`PostalAddress`](https://schema.org/PostalAddress) with the fields `postalCode`, `addressRegion`, `streetAddress`, `addressCountry` and `addressLocality`.
### Handling of visibility
Does not seem to be handled.

View file

@ -1,31 +0,0 @@
# External work
Work done on other projects for interoperability. If the discussion is complete or a pull-request/fix is merged it is marked by [x].
## Wordpress ActivityPub
- [x] [Pull Requests: Add/event objects ](https://github.com/Automattic/wordpress-activitypub/pull/629)
- [ ] [Pull Requests: Add/Advanced Follow Management](https://github.com/Automattic/wordpress-activitypub/pull/622)
## Mobilizon
- [x] [Improve (fix) detection of Banner Image](https://framagit.org/framasoft/mobilizon/-/merge_requests/1527/)
- [x] [Review/Bugreport for FEP-2667 implementation](https://framagit.org/framasoft/mobilizon/-/merge_requests/1507#note_2037833)
- [x] [Bugreport for relay following](https://framagit.org/framasoft/mobilizon/-/issues/1392)
- [x] [Report on missing info about remote event visibility](https://framagit.org/framasoft/mobilizon/-/issues/1385)
- [x] [Context for Place](https://framagit.org/framasoft/mobilizon/-/issues/1388)
- [x] [pure text address fields](https://framagit.org/framasoft/mobilizon/-/issues/1387)
- [x] [Bug report for ical:status not being compacted](https://framagit.org/framasoft/mobilizon/-/issues/1378)
- [ ] Report missing context for externalParticipationUrl](https://framagit.org/framasoft/mobilizon/-/issues/1376)
## Gancio
- [x] [Issue: Summary vs content](https://framagit.org/les/gancio/-/issues/304)
- [x] [Improve json-ld representation of events ](https://framagit.org/les/gancio/-/merge_requests/33)
- [x] [Discussion: HTML should be supported for summary](https://framagit.org/les/gancio/-/issues/321)
## Plemora
- [x] [Review/Suggestions for the Pull request adding Mobilizon compatible objects](https://git.pleroma.social/pleroma/pleroma/-/merge_requests/3955)
## Socialhub activitypub
- [ ] [Discussion for Events Interoperability: Validation, minimum requirements, common extensions](https://socialhub.activitypub.rocks/t/events-interoperability-validation-minimum-requirements-common-extensions/3849/1)
- [ ] [Instance Federation: Visibility of remote Events ](https://socialhub.activitypub.rocks/t/instance-federation-visibility-of-remote-events/3850)

View file

@ -1,21 +0,0 @@
# Focal Point
Support various focal point plugins, because on ActivityPub we have less control how images are rendered on the other side.
https://docs.joinmastodon.org/spec/activitypub/#focalPoint
## Image Background Focus Position
https://www.wordpress-focalpoint.com/
Meta field: `bg_pos_desktop`
Value: string, e.g. `50% 50%`, like the css option [object-position](https://developer.mozilla.org/en-US/docs/Web/CSS/object-position)
## WP Smart Crop
https://www.wpsmartcrop.com/download/
Meta field if enabled for this image: `_wpsmartcrop_enabled` bool
Meta field: `_wpsmartcrop_image_focus`
Value: array with keys `top` and `left` which are floats.