Commit graph

40 commits

Author SHA1 Message Date
Matthias Pfefferle
8bff92d260
initial (#867) 2024-09-13 18:21:11 +02:00
Matt Wiebe
08106890a3
Add Blog extra fields (#838)
Imitate User Extra Fields, and consolidate into an `ExtraFields` class

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2024-08-09 09:40:35 -05:00
Matt Wiebe
353d848ef7
Only send Update for previously-published posts (#833) 2024-08-01 09:43:11 +02:00
Daniel Hüsken
fae1723119
Changed missing activitypub_user_description to activitypub_description (#830) 2024-07-30 11:06:36 +02:00
Matthias Pfefferle
6328dbb924 send update when header image changes 2024-07-19 22:41:01 +02:00
Matthias Pfefferle
d2260639b3
Add extra fields (#762)
* add extra fields settings

* add settings

* add settings link

* allow users to only edit their extra fields

* use nopaging instead of posts_per_page

thanks @mattwiebe

* load filters only on admin page and remove the view actions

* author should not be editable

* some improvements and extra informations

* description

* use nopaging instead

* add blog url

* formatting

* formatting

* some cosmetics

* return attachments

* formatting

* formatting

* add default extra fields

* remove unused migration

* better defaults handling

* use a filter to be able to unhook/replace default extra fields

* should fix #810

---------

Co-authored-by: Matt Wiebe <wiebe@automattic.com>
2024-07-15 18:03:40 +02:00
Matthias Pfefferle
5f595c6354
Support Drafts! (#780)
* init

* remove images, text and summary if post is converted to draft

* remove debug infos
2024-07-02 11:00:42 +02:00
Matthias Pfefferle
f4adecddf6 also delete interactions with this person! 2024-04-18 18:08:01 +02: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
9cf521c9b9
Prevent scheduler overload (#700) 2024-02-23 17:58:02 +01:00
Matthias Pfefferle
20adc4cc97 fix #690 2024-02-11 12:44:46 +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
Jan Boddez
a1f513393e
Update class-scheduler.php (#679) 2024-01-27 17:30:45 +01:00
Matthias Pfefferle
fba1c42dc0
fix comment update federation (#651)
fix #649
2024-01-12 10:08:07 +01:00
Matt Wiebe
3cda64a255
Profiles: Update followers when profile fields change (#542)
* Profiles: update followers when profile fields change

* use static

* only try to merge mention inboxes when valid

* cleanups

* add hook to wp_update_user

* update readme

---------

Co-authored-by: Matthias Pfefferle <pfefferle@users.noreply.github.com>
2023-12-22 11:33:25 +01:00
Matthias Pfefferle
b744dc551d
Comment Federation (#550)
* Comments 1

* Delete FUNDING.yml

* Add basic BuddyPress support

fix #122

thanks and props @skysarwer

* change URL to `bp_core_get_user_domain`

* fix "Follow" issue

fix #133

* fix #135

* version bump

* Create phpunit.yml

* Update composer.json

* Update composer.json

* Update phpunit.yml

* Update composer.json

* Create phpcs.yml

* Update phpcs.xml

* Update composer.json

* phpcs fixes

* fix typo

* Comments update

* webfinger_extract remove extra param

* coding standards

* Replies Collection, settings, other fixes

* Create stale.yml

* move stale file

* code standards cleanup

* Migrate / Update script

* bugfix

* add settings link to plugin page

* fix code standards

* fix cs

* fix PHPCS

* PHPCS fixes

* change background image for wp.org

* fix docker

* fix webfinger for email identifiers

fix #152

* version bump

* update composer file to fix unit testing

* allow plugins

* fix dependencies

* Migrate tools

* code cleanup

* regression fix

* Fix announce, clarified language

* update included filename

* code cleanup

* Improve migration UX

* Add comments view, warnings to migrate page

* style fix

* more style fixes

* Fix send_delete_activity

* replace ap_comment_id to reuse  replytocom var

* Comments class missing attributes

* Post class fix attributes

* move js file to assets/js

* Separate file for Comment processing hooks

* fix file path

* associate comments to back compat post

* Fix js assets enqueue

* change regex matching potential hashtags

Matches any string starting with '#' and consisting of any number and combination of [A-Za-z0-9_] that is directly followed by whitespace or punctuation. Groups everything after '#' for access in functions using this regex.

This fixes #183 (incomplete links on hashtags containing special characters) by not matching these at all.

* also detect hashtags at the start of a paragraph

* restrict html tags after which to detect a hashtag

Hashtags should not be detected after just any html tag - for example not after an opening a or div. To still allow detection at the start of a line, allow specifically p and br to directly precede a hashtag.

* fix pagination

* Add Custom Post Type support to outbox API

* remove comment_type

* fix comparison

* remove trailing spaces

* fix phpcs issues

* fix phpcs issues

* run phpcs also on pull_requests

* fix phpcs issues

* support threaded comments from ActivityPub

* refactor support for threaded comments from ActivityPub

* remove debugging log line

* add first unit tests for class inbox

* fix code smells

* make filter function static

* attempt to resolve backwards compatibility issues

* update js to new file

* delete old js

* Remove migrate code

* update post meta canonical

* remove type and mention meta from comment filters

* extract mentions from comment_content

* phpcbf

* remove extra curly bracket

* Remove migrate code

* remove version_check()

* Update enqueue scripts

* Remove remote comments from preprocessing

* Reply to comments from Dashboard

* rename function, inserts users into reply text

* Update dispatch comments

* update comment model

* fix comment model replies property

* fix preprocess_comment cap check

* Add webfinger filter to comments

* Add comment edit datetime

* cleanup

* fix var name

* cleanup

* phpcbf

* better actual translation support

* Separate comment reply script

* migrate dispatch, migrate comment model to transform

* ignore WP_Comment type for now

* Adds new helpers for resolving inReplyTo url

* Update activitypub_send_comment_activity to include type

* remove redundant id check

* reinclude user_id in saved ap_object meta

* update post field meta

* Fix comment updated datetime

* front-end reply inserts @mentions

* enqueue reply script on front end

* use const instead of dirname

* some simplifications

* move some functions

* fixes

* some more fixes

* fix namespace

* fix unittests

* fix testcase

* fixed typo

* fix tests

* fix tests

* fix PHPCS

* move functions to transformer class

* fix warnings

* Link remote comments on frontend

* Link to comment source as row action

* Init Comments class

* remove dead dispatch action

* re-add extract mentions filter

* Restore and tweak Comment transform

* Schedule comments activities for non-admin users

* lint

* remove context property

* rename get_id method to generate_id

* fix locale

* move functions

* PHPDoc

* this is never used

* remove some edit methods

* remove replies for now

* remove JS calls

* remove reply_recipients

* never used

* remove other query-vars

* otherwise to_json would not work properly

* small changes

* use `c` for comment IDs

* remove comments.php for now

maybe re-add it later

* wp_insert_post is an action

* also parse comment_text

* remove duplicate functions

* add Base transformer

* remove invalid test

* update to new query var

* update dispatcher to support comments and posts

* fix transition

* remove unused functions for now

* schedule_comment_activity seems to ignore create and update

* fix wrong use of functions!

* not every platforms sends an URL

* check source-id first

* remove hashtags for now

* fallback to ID

* fix typo

* move to_activity to Base class

* remove unused function

* add support for announce and like

* also ping inboxes of other commenters in the thread

* restructure WebFinger class

* some small improvements

* simplified to_object class

props @Menrath for the feedback and the idea!

* fix unit tests

* make transformer filterable

/cc @Menrath

* use transformer factory, so that transformer can be overwritten

* phpcs fixes

* fix attachments

* fix comment transformer

* remove comments for now

* update readme/changelog

* simplify and unify json_encodes

---------

Co-authored-by: Django Doucet <mediaformat.ux@gmail.com>
Co-authored-by: Andreas <andreas@bocops.de>
Co-authored-by: Eana Hufwe <eana@1a23.com>
Co-authored-by: Matthew Exon <git.mexon@spamgourmet.com>
Co-authored-by: Django Doucet <django.doucet@webdevstudios.com>
2023-12-22 10:12:26 +01:00
Matthias Pfefferle
4a72329bbe fix #573 2023-11-29 10:47:31 +01:00
Matthias Pfefferle
b3e5bad89c
reduce number of checks when system cron is not used (#472)
* reduce number of checks when system cron is not used

* add health check
2023-09-27 11:14:52 +02:00
Matthias Pfefferle
addd7dd8a1
better handling when data is missing (#444)
* better handling when data is missing

* WP_Error: add translation key and status

* do not use cache for cleanup and update

* better queries
2023-09-21 16:26:17 +02:00
Matthias Pfefferle
835af08848 some small fixes 2023-07-28 10:28:55 +02:00
Matthias Pfefferle
96c1e92151 optimize and simplify followers 2023-07-06 14:42:18 +02:00
Matthias Pfefferle
47957c2a6a fix code 2023-07-03 19:52:54 +02:00
Matthias Pfefferle
493b8ffad5 use transformer instead of post-model 2023-07-03 17:59:42 +02:00
Matthias Pfefferle
359eabf671 use collection instead of factory 2023-07-03 11:20:44 +02:00
Matthias Pfefferle
f207089269 revert scheduler/dispatcher changes 2023-06-30 16:08:28 +02:00
Matthias Pfefferle
ced8cd0e29 send activities for blog-wide user 2023-06-29 19:10:49 +02:00
Matthias Pfefferle
3e969c859a send blog-wide activities if enabled 2023-06-29 18:44:25 +02:00
Matthias Pfefferle
5f1abd2461 fail early 2023-06-27 14:29:42 +02:00
Matthias Pfefferle
a8fe587f91 prepare federation method 2023-06-27 14:29:42 +02:00
Matthias Pfefferle
5478be1355 a follower is now a valid ActivityPub Actor
this helps with API handling
2023-06-23 14:54:29 +02:00
Matthias Pfefferle
758912da64 do not use cache for new followers 2023-05-31 14:03:46 +02:00
Matthias Pfefferle
084f108161 only schedule migration if DB is not on the latest version 2023-05-31 10:48:51 +02:00
Matthias Pfefferle
b803914180 removed output formatting 2023-05-11 09:46:26 +02:00
Matthias Pfefferle
6fce2c30d2
Update includes/class-scheduler.php
Co-authored-by: Alex Kirk <akirk@users.noreply.github.com>
2023-05-10 18:47:46 +02:00
Matthias Pfefferle
463bff834b delete if response code is 410 or 404 2023-05-10 17:21:59 +02:00
Matthias Pfefferle
2570928b00 PHPDoc 2023-05-10 14:55:10 +02:00
Matthias Pfefferle
17b66cb23d implement cleanup_followers and update_followers 2023-05-10 14:18:56 +02:00