-
Notifications
You must be signed in to change notification settings - Fork 80
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 like handler #804
Add like handler #804
Conversation
On my personal site I don't need this, as I have my own such filter and block. But I thought I'd mention it. |
@janboddez thanks a lot! Do you think we need a UI/setting for that? It might be confusing if "Like" comments will simply show up in the comment section after the next update!?! |
Yes, I do think you will need a I'm not sure about showing/hiding them in WP-Admin. It could be confusing (for people who aren't familiar with, e.g., webmentions) to see "comments" in WP-Admin but not see them show up anywhere on the site. Hmm, maybe we need a completely separate WP-Admin (sub)menu for "likes"? Or you could put the whole functionality behind a constant or something, so that "advanced" users (who might have their own means of displaying likes) can choose to enable it at their own risk. |
and copied basic comment_type support handling from the Webmention plugin
@janboddez I refactored the code a bit and also added Announce support! What do you think? I am not very happy with the Maybe we also hide it behind a feature flag, to run some tests and think about a nicer UI? /cc @mattwiebe |
Cool! Feature flag (like a PHP constant?) seems like a good idea! I can imagine most people wanting to have this disabled or at least not show the likes/reposts until there's something like a Facepile block (or some other way of displaying likes/reposts, like a counter of sorts). Not everyone will want to install IndieBlocks either, haha! Are the |
Yes!
Kind of both! The ActivityPub version is stripped down a lot, so they are not completely identical, but they use the same vocabulary, so that there is no difference between a Webmention |
Silly question: Do we also need some custom CSS to make likes look "good" in WP's dashboard? Like in pfefferle/wordpress-webmention#396. Didn't yet have a chance to test, but basically the question is: How do [likes and reposts] look (in the dashboard) with the Webmention plugin turned off? |
The Webmention Plugin does not change the UI of the dashboard! |
Oh, I thought we added a bit of CSS to make like and reposts avatars behave. |
You are totally right! I will add that! |
Adds basic support for incoming likes (see #235).
Probably needs to go through a couple more iterations before it could be merged! For instance, the ActivityPub plugin should maybe also get a
pre_get_comments
filter, similar to the Webmention plugin, so that these "likes" don't show up among "regular comments." Should be "rather easy" to implement.But it's a "first draft."
I originally wanted to also add "repost" support but noticed an announce handler already exists. I'm going to have to check that out later. Maybe in a different PR.
Edit: This won't actually display, e.g., a facepile. Though it currently is compatible with IndieBlocks' Facepile block. I can imagine you'd want to eventually add a block of your own ...
Proposed changes:
Note: I kept some of the actions from other reaction handlers and also set some comment meta to be able to later on display the like in a "facepile" kind of way. I also set some "dummy" content; feel free to change it in order to have it behave the same as, e.g., the Webmention plugin.
Other information:
Testing instructions: