Commit graph

779 commits

Author SHA1 Message Date
Matthias Pfefferle
a1c7bc06cc Add some comment infos 2024-03-22 11:53:57 +01:00
Matthias Pfefferle
3688817cf4 mark links as "unhandled-link" and "status-link" 2024-03-14 16:09:12 +01:00
Matthew Exon
1f22ad85f6
Clarify how to set correct permalink structure (#664) (#710)
* Clarify how to set correct permalink structure (#664)

* Update includes/class-admin.php

---------

Co-authored-by: Matthew Exon <git.mexon@spamgourmet.com>
Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-03-13 09:36:15 +01:00
Kaspars Dambis
343a3b5c67
Enqueue reply assets only if there is anything to reply to on the page (#706) 2024-03-12 12:57:07 -05:00
Matthias Pfefferle
e4ea69ca6f text 2024-03-12 08:31:31 +01:00
Matthias Pfefferle
79f400d88a
Improve User management (#703)
* Use an ActivityPub capability to better enable/disable ActivityPub support

* split PRs

* remove test hook

* do not run migrations for new installs

* fix unit tests

* fix unit tests

* remove abandoned schedule!

* fix migration class

* fix order

* restructuring

* remove follower migration

* do not yet remove legacy followers

* remove blog-user changes

* use a const for the version number

* add user tests and fix old ones

* use a more generic async migrator

* optimized test
2024-03-11 15:19:07 +01:00
Matthias Pfefferle
96626c6438 better validity checks 2024-03-07 16:19:34 +01:00
Matthias Pfefferle
fb0e23e885 better class handling 2024-03-05 09:39:43 +01:00
Matthias Pfefferle
02a86ced95 html_entity_decode text 2024-02-29 15:13:42 +01:00
Matthias Pfefferle
56748f6db8 fix check! 2024-02-29 15:08:27 +01:00
Matthias Pfefferle
cbbbd70890
A better default content handling based on the Object Type (#661)
* nicer default handling!

* use attachment based on the object type

* fix typo

* C&P issue

* update settings

* add default post format

* mixed up `post_format` with `object_type`

* use h2 instead of strong

* add theme support for `post-formats`

if using that feature for ActivityPub

* use Note instead of `image`, `video` and `gallery`

* add `alt` support for images

fix #94

* set type to `Note` if post-type has no title support

* better check

* hide "Post content" when WordPress-Post-Format is selected

* add ACTIVITYPUB_DEFAULT_OBJECT_TYPE const

* move some code

* use note as default
2024-02-29 14:47:10 +01:00
Matthias Pfefferle
9cf521c9b9
Prevent scheduler overload (#700) 2024-02-23 17:58:02 +01:00
Matthias Pfefferle
5988736b14
Add/remote reply (#689) 2024-02-22 16:32:16 +01:00
Matthias Pfefferle
6265f6626e
also support application/ld+json mime-type with AP profile (#696) 2024-02-15 00:16:46 +01:00
Matthias Pfefferle
7913faaa77
Add @ prefix to Follow-Block (#694) 2024-02-13 10:51:19 +01:00
Matthias Pfefferle
1d6c8eaab0
Apply comment_text filter to Activity (#695) 2024-02-13 10:51:01 +01:00
Matthias Pfefferle
61b770f40d fix reply-context 2024-02-12 11:57:57 +01:00
Matthias Pfefferle
2705703ced
Add all repliers as Mentions (#692)
* Add all repliers as Mentions

Add all repliers as Mentions so that they receive notifications.

See: https://wordpress.org/support/topic/ux-deviation-from-expected-behaviour-in-2-0/

* Fix readme

* typo
2024-02-12 11:30:01 +01:00
Matthias Pfefferle
dd911564ce fix version number 2024-02-12 11:16:17 +01:00
Matthias Pfefferle
3b21061c49
re-add vary header (#683)
* re-add vary header

fixes #580

* add Const to enable/disable `Vary` header

* lets start with default "off"
2024-02-12 11:09:16 +01:00
Matthias Pfefferle
20adc4cc97 fix #690 2024-02-11 12:44:46 +01:00
Matthias Pfefferle
223270f2a7 queue only deletes if follower exists 2024-02-10 20:41:47 +01:00
Matthias Pfefferle
2ed1534471 move generate_id to utils class 2024-02-09 16:31:09 +01:00
Matthias Pfefferle
ec24523df2 only disable comments for replies from the fediverse 2024-02-09 15:49:38 +01:00
Jan Boddez
742fbda212
Update class-scheduler.php (#688) 2024-02-09 14:08:18 +01:00
Matthias Pfefferle
98824d3a08 tweak federation state a bit 2024-02-07 17:54:48 +01:00
Matthias Pfefferle
a4f8c3084d fix comment federation
fix #671

@janboddez comments from a blog owner, that are direct replies to the post should now be federated properly. can you verify that?
2024-02-06 10:14:42 +01:00
Matthias Pfefferle
1fc6869576
improve federated comments (#645)
* fix some times broken reply context

* revert changes

* add a filter to finally verify if an activity should be send or not

* better local comment handling

do not federate local only comments (fix #652) and hide "reply" link for federated comments

* show JSON only for comments that should be federated!

* fix parent_comment handling

* show external id if exists

* disable "edit comments" for federated comments

* some more doc

* added tests

* fix #658

* allow custom reply link!

* some restructurings

* this will be only a minor release

* version bump

* mark WordPress object as federated

* fix content filter issue!

fixes https://wordpress.org/support/topic/yasr-ratings-appear-on-comments-on-mastodon/

* add custom filter

thanks @janboddez for the idea https://github.com/Automattic/wordpress-activitypub/pull/645#issuecomment-1898820529

* optimize code a bit

* consts to enable/disable incoming/outgoing interactions

see https://wordpress.org/support/topic/how-to-suppress-user-comments-from-feed/

* rename state

* cleanup federation check

* fix markdown

* better handling of Create/Update/Delete

* update check
2024-02-01 11:17:03 +01:00
Matthias Pfefferle
484cc56677
fix ActivityPub @context (#682)
The `call_user_func` version seem to not work properly in this case.

/cc @Menrath
2024-01-31 16:31:22 +01:00
Matthias Pfefferle
c3c987a765
improve the settings screen (#681) 2024-01-30 21:29:09 +01:00
Jan Boddez
a1f513393e
Update class-scheduler.php (#679) 2024-01-27 17:30:45 +01:00
Jan Boddez
2b8480fa1c
Fix #621 (#677)
* Update class-follower.php

Just a test

* Update class-follower.php

* Update class-follower.php

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-01-26 17:37:13 +01:00
Matthias Pfefferle
48feabe39e
Improve post-type support (#675)
* Improve post-type support

* Remove `page` from default types (fix #665)
* Add description to settings (fix #673)

* fix tests
2024-01-25 15:51:21 +01:00
Matthias Pfefferle
1a7c9a5ea9 better checks to prevent possible PHP errors 2024-01-22 12:15:33 +01:00
André Menrath
174262d22c
Add/event objects (#629)
* remove redundant property definitions

* Add redused context for actors.

* Add classes to construct Moblizon compatible events

* Bind the context to the activitypub object
- 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

* fix phpcs

* Remove PostalAddress object: it's enough (at least atm) to directly write the array in transformers.

* Remove _context property from ActivityPub objects in favour of getter function get_json_ld_context()

* fix unit tests: ActivityPub Activity objects have a custom getter for the JsonLD context

* fix phpcs

* fix unit-tests to also support php5.6

* fix phpcs

* add param include_json_ld_context to to_array function
This allows to not set the @context in the resulting array.

* propagate the param include_json_ld_context to nested calls of to_array.

* fix phpcs

* Nested AcitivityPub objects: never build context in inner items in to_array function

* fix: param of set_address may also be an array

* fix typo in comment

* always prefix json-ld context with json-ld and move event class to sub-namespace

* fix usage of reserved object keyword
seems it should not be used as a namespace either

* Merge commit 'b2271cda6b857f879e0abd4f3c6683642d725267' into add/event-objects

* Fix calling non-static function as static

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>

* Partly fix Json-LD contexts in collections

* Update includes/activity/class-base-object.php

* this is implicit

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 change prevents the Activity to re-use Object vars

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

* add `$include_json_ld_context` support to `to_json`

* disable some more contexts

* remove whitespace

* Add php-comment for 7ed17c042a

* Fix JSON-LD context for ActivityPub objects: child classes may override it.

* coding standards

* call folder/namespace `Extended_Object`

 to be consistent with folder names in singular

* fix: unnessesary nesting of extended-objects

* remove license

I hope this is fine, to have the complete plugin under the MIT @Menrath ?!?

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-01-18 16:35:52 +01:00
Matthias Pfefferle
b612ce0f8e check if blog author is enabled or not
thanks for your help with debugging @akirk
2024-01-18 15:54:42 +01:00
Matthias Pfefferle
4fafea35e7
implements a basic followers endpoint for the mastodon api (#666)
* implements a basic followers endpoint for the mastodon api

see https://github.com/akirk/enable-mastodon-apps/pull/67

/cc @akirk

* fix php 5.6 issue
2024-01-18 13:38:02 +01:00
Matthias Pfefferle
b2271cda6b unschedule old hooks
related #639
2024-01-13 20:29:16 +01:00
Matthias Pfefferle
d6842616c7 fallback to ID id URL is not set 2024-01-12 16:51:33 +01:00
Matthias Pfefferle
88ab98005e fix deprecated class 2024-01-12 16:07:48 +01:00
Matthias Pfefferle
9f09bfbcf4 re-add Post model
workaround for #639
2024-01-12 16:02:40 +01:00
Matthias Pfefferle
e23c65f295 remove whitespaces 2024-01-12 10:10:14 +01:00
Matthias Pfefferle
fba1c42dc0
fix comment update federation (#651)
fix #649
2024-01-12 10:08:07 +01:00
Jan Boddez
b243ca9301
Update class-activitypub.php (#650) 2024-01-11 22:41:47 +01:00
Matthias Pfefferle
f7d535b885 Revert "introduce a filter to check if an activity should be sent or not"
This reverts commit 62b73d251a.
2024-01-11 14:15:46 +01:00
Matthias Pfefferle
62b73d251a introduce a filter to check if an activity should be sent or not 2024-01-11 14:15:15 +01:00
Matthias Pfefferle
bdd8ab804f fix mentions and finally add dot support 2024-01-10 20:57:40 +01:00
Matthias Pfefferle
48a33b82e9 always use application user to check webfinger endpoint
see #627
2024-01-10 11:06:01 +01:00
Sam Lade
d09b2ae9f3
Fix classic editor image finding for large images (#643)
The filename with -scaled in it is used as the primary key in this case.
Fix lookups to take this into account.
2024-01-10 10:44:45 +01:00
Matthias Pfefferle
20a49edb1b fix #627 2024-01-10 10:27:05 +01:00