janboddez / indieblocks

Use blocks, and, optionally, "short-form" post types to more easily "IndieWebify" your WordPress site.
https://indieblocks.xyz
GNU General Public License v3.0
22 stars 3 forks source link

Salmention support? #151

Closed janboddez closed 5 months ago

janboddez commented 9 months ago

Looks like the mf2 parser may include like, repost, comment, bookmark "properties." So if someone commented on one of our posts and sent a mention, we could loop over those and create/update/... (threaded, if supported) comments for 'em, too.

Then if one of those comments mentioned us directly, there might be duplicates, but we can probably weed those out manually.

Not sure about deletes.

(I don't think very many people do this anyway, so a very experimental implementation, if any, is probably good enough.)

Not sure if we should send out webmentions when we receive comments; I think we can do that later.

janboddez commented 9 months ago

Also, doesn't make sense to display someone else's likes. :-) So only comment is relevant.

janboddez commented 9 months ago

So we'd need to somehow grab $result here. https://github.com/janboddez/indieblocks/blob/50111bb4c4366d3aa83c3e366d5153509c3738b1/includes/class-webmention-receiver.php#L279C5-L279C5

And then somehow get the parser instance for that comment (or create a new one, and check for a comment property, and set up commentdata for each comment that doesn't yet exist (how to check this? just let WP detect dupes? or a smarter way?) and then update/overwrite that based on the actual content ... and then create a new comment (or update an existing one---how?)

janboddez commented 5 months ago

While it is certainly doable to also parse remote posts' comments, this is just kinda low prio right now.