comments icon indicating copy to clipboard operation
comments copied to clipboard

Add `hasVoted()` function for comment

Open engram-design opened this issue 3 years ago • 2 comments

Similar to hasFlagged() we want to know when a user has already voted on a comment.

engram-design avatar Mar 25 '22 06:03 engram-design

Hi, does something like this exist now? Or is there a good workaround for it?

pimago avatar Nov 17 '24 09:11 pimago

Not implemented currently, but you can handle this logic yourself.

$hasDownVoted = Comments::$plugin->getVotes()->hasDownVoted($comment, $user);
$hasUpVoted = Comments::$plugin->getVotes()->hasUpVoted($comment, $user);

engram-design avatar Nov 17 '24 10:11 engram-design