Comments (10)
Since it's rather unlikely we have an application/activity+json
response stored in cache anywhere, we should probably always perform a new request. Good thing is, it can be a HEAD request only.
from addon-for-activitypub.
So, turns out it can't be a GET request, at least not for WordPress posts ...
Still, see 42a9e1f.
This requires a change to IndieBlocks, though, because it doesn't store a linked URL for replies. And if a reply is a bookmark, too, the linked URL would be the bookmarked URL ...
So we have to extract the in-reply-to
URL another way.
Worst case, we'd have to bundle php-mf
. In fact, because the u-in-reply-to
class can be set on various elements, it's best to stay away from regexes ... So we either use IndieBlocks' Reply block, check for its URL attribute. Or use php-mf
indirectly, by letting IndieBlocks do the parsing. Or drop the IndieBlocks requirement and ourselves also include php-mf
.
from addon-for-activitypub.
Or drop the IndieBlocks requirement and ourselves also include
php-mf
.
While this would mean we have 3 or so (scoped) instances of php-mf
running (dang non-existent WordPress dependency management), it'd also be the most robust.
I think this is the way to go.
This requires a change to IndieBlocks, though, because it doesn't store a linked URL for replies. And if a reply is a bookmark, too, the linked URL would be the bookmarked URL ...
Reason for that was that the _indieblocks_linked_url
was meant to be used for optionally including titles for certain notes (likes and bookmarks, namely), should an author want that. (It is updated with each save in order to not have to parse posts on render.) Replies were never the target.
from addon-for-activitypub.
Having a copy of php-mf
on board would also help get rid of this here regex:
Rather than look for a div
, we should just parse the post and look for the "mf2 content" property. Should also not start off the post_content
but instead use the "filtered" content, to accommodate plugins that add mf2 dynamically.
from addon-for-activitypub.
If there's no explicit @-handle in the post, we can perhaps fetch the remote object's actor in order to ensure proper mentions.
from addon-for-activitypub.
If there's no explicit @-handle in the post, we can perhaps fetch the remote object's actor in order to ensure proper mentions.
Way I used to do it, it'd look for such a handle explicitly. Causing the AP plugin to add the correct tag and cc properties.
"tag": [
{
"type": "Mention",
"href": "https://indieweb.social/users/janboddez",
"name": "@[email protected]"
}
],
"updated": "2024-05-01T19:11:44Z",
"url": "https://jan.boddez.net/notes/9cd1e6db34",
"to": [
"https://www.w3.org/ns/activitystreams#Public",
"https://jan.boddez.net/wp-json/activitypub/1.0/users/3/followers"
],
"cc": [
"https://indieweb.social/users/janboddez"
]
Can probably try and look for the attributedTo
property on the remote object. Not sure if we need the handle, too.
To get the handle, we might be able to use webfinger with the attributedTo
URL and look for a subject
in the form of acct:[email protected]
, then swap the acct
for @
.
from addon-for-activitypub.
Rather than look for a
div
, we should just parse the post and look for the "mf2 content" property.
That's what we do now. And we store the resulting inReplyTo URL in a custom field, in order not to have to parse the content and fetch the remote page each and every time the page is viewed.
from addon-for-activitypub.
It's now possible to add the mention. Except it won't actually send the post to the other party's inbox, because all this happens too late in the cycle.
Maybe we can hack the activitypub_send_activity_to_followers
filter, as $activity
is passed to it as an argument (by reference, normally, so we should be able to update its cc
prop).
from addon-for-activitypub.
Maybe we can hack the
activitypub_send_activity_to_followers
filter, as$activity
is passed to it as an argument (by reference, normally, so we should be able to update itscc
prop).
Whoops, guess not.
from addon-for-activitypub.
Mentions should now work: 7ab06ef.
from addon-for-activitypub.
Related Issues (20)
- Move "unlisted comments" behind option
- Completely remove IndieBlocks dependency HOT 1
- Implement "limit updates" HOT 1
- Translate "reposts" to proper boosts HOT 5
- (Author) profile "templates"? HOT 1
- "Don't federate post" filter HOT 3
- Delay scheduling Gutenberg posts to `rest_after_insert_{$post->post_type}` HOT 7
- Undoing of announces seems to never run or get federated
- Boosts don't seem to federate to all followers HOT 6
- Implements likes
- Reschedule failed requests?
- Use ACTIVITYPUB_REST_NAMESPACE
- Improve avatar caching/updates HOT 1
- Close AP comments after a certain amount of time
- Content warnings
- Post format support
- Add incoming likes and reposts HOT 5
- "Reply on the Fediverse" filter
- Enable editing incoming interactions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from addon-for-activitypub.