FriendsOfFlarum / gamification

Add upvotes, downvotes, and ranks to your Flarum Community
https://discuss.flarum.org/d/20671-friendsofflarum-gamification
MIT License
36 stars 17 forks source link

Fix post number condition in `Gamification::convertLike()` #86

Closed rob006 closed 1 year ago

rob006 commented 2 years ago

This looks like a typo. However the are other solutions that I do not understand:

  1. In AddVoteHandler there are no such condition at all: https://github.com/FriendsOfFlarum/gamification/blob/eab4c033e2996012485881f14d7d5af83db54a4f/src/Listeners/AddVoteHandler.php#L49-L56
  2. In SaveVotesToDatabase there is a different method to detect first post: https://github.com/FriendsOfFlarum/gamification/blob/c23465898270f4a5acbb5b86daba0b6950341020/src/Listeners/SaveVotesToDatabase.php#L167-L171
  3. Why do we first calculate votes for discussions and users, and then add new vote? In that case calculations uses outdated votes list?

Confirmed