-
Notifications
You must be signed in to change notification settings - Fork 83
Add Undo functionality #1301
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 Undo functionality #1301
Conversation
|
Tests fail because the activity saved in Outbox items has |
4a2fd82 to
8ad2832
Compare
|
@pfefferle Setting the default for Not sure how you feel about defaulting to an empty array for it in |
|
New approach: Being more prescriptive than checking for |
mattwiebe
left a comment
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.
This seems good to me.
Where, if anywhere, could we also expose this in the UI? Should we add a wp-cli command?
|
I like that, yes! |
|
Added a cli command in f5b2b1f |
Fixes #1289
Proposed changes:
get_activity()andget_author()methods toOutboxclass, where they feel more appropriate. These methods take an outbox id.undo()method toOutboxclass, that accepts an outbox item and creates an Undo activity based on it. It accounts forCreateandAddactivities requiring their own "undo" type.Base::transform_object_properties()andBase_Object::to_array()to not only discardnullvalues but also empty values unless they'refalse.Other information:
Testing instructions:
wp activitypub undo 123where 123 is an Outbox post id.wp activitypub undo "https://example.com/?post_type=ap_outbox&p=123"where the URL is an Outbox post guid.Base::transform_object_properties()andBase_Object::to_array()are probably what has the highest potential for unintended consequences. Anything standing you there?