I’ve opened a PR to allow anonymous users to “like” posts. It’s a SiteSetting so admins have the option of enabling or disabling the feature.
Could I please get a code review?
Context: I’m part of a 501(c)3 discourse where our accounts are registered under our actual names.
We encourage anonymous discussion, as some people want to share about personal experiences and sensitive topics. (mental health, difficult past memories, etc). The anonymous discussion has been extremely rich and helpful, and adding an anonymous “like” feature would help us gauge community interaction on topics where people might strongly empathize or agree but not feel comfortable putting their name out there.
Could I please get a quick tip on where to invoke the disallow icon? I’ve taken another look but I can’t quite figure it out.
From GH comment:
Hi @nattsw, thank you for the second review. I’m having a bit of trouble figuring out where the disallow is supposed to happen since post_undo_action_window_mins is only referenced in can_delete_post_action?, and the method is correctly returning false once the post_undo_action_window_mins has passed.
However, despite this method returning false correctly after the window has closed, the disallow symbol does not appear, but there is no other method that references post_undo_action_window_mins. I realize that can_delete_post_action? is called when the page is loaded, but I can’t quite locate where the actual disallow icon is invoked.
Could you please point me towards the block of code that calls the disallow symbol? Thank you!
Thank you for the tip! That was super helpful! I’ve pushed a patch, manually verified the behavior, and added additional test coverage. It’s ready for another round of review when you have the chance.