-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add/event objects #629
Add/event objects #629
Conversation
- change the propertyname which stores the json-ld context from context to _context, because context is already reserved in the ActivityStreams vocabulary. - cleanup currently unused code
The Can we maybe find a way to have only the context attribute and work with |
Or maybe don't use a property for the JsonLD context at all, just use a getter function called "get_json_ld_context". |
Ah, that is the difference! Makes sense! Then I would really vote for having it only as const and think about how to handle it in |
…rite the array in transformers.
… function get_json_ld_context()
… the JsonLD context
This allows to not set the @context in the resulting array.
Converted it to draft to signalize that there is no hurry and we might discover some little enhancements in the next few weeks anyway! |
seems it should not be used as a namespace either
Co-authored-by: Matthias Pfefferle <[email protected]>
…vitypub into add/event-objects
We already set the correct user with `$transformer->change_wp_user_id( $user_id );` so the Actor will be generated properly. We can change the behaviour, but we should not use both.
this should stay as is, because it pre-fills the Activity with data (for example cc and to) and it will no longer be done with your change. It is on purpose that it first sets the object and then replaces it with the URI. See: https://github.com/Automattic/wordpress-activitypub/blob/master/includes/activity/class-activity.php#L195
@Menrath I added some changes, can you verify them and I had one more inline question! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e8db7e9
Great that you saw that, it was probably a leftover before the function change_wp_user_id was available: Mobilizon currently requires the actor attribute also on the event object itself, although it is against the ActivityPub standard.
e667b76
to
4957294
Compare
@pfefferle Thanks for your review again! Looks good to me! A slightly off topic last question that comes to my mind: what about calling the |
to be consistent with folder names in singular
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops 😳
thanks!
I hope this is fine, to have the complete plugin under the MIT @Menrath ?!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixed licensing. I have no experience to be honest. I am fine with it. Our extensions plugin will be AGPLv3 only though :)
What an enormous PR! Congrats and Thank you very much for your contribution @Menrath and @pfefferle … and all this even without an issue ;) |
I started this pull request as a minimal one, with only adding an Event class but I ended up also shaping the way the Json-LD context is build a bit. It is now tied to the ActivityPub objects.
Reason: Don't store and send context which is never referenced.