Do not send notifications when user likes or repeats someone's status again and again
How to reproduce the like-unlike-like notifications:
- Like someone's status
- Unlike it
- Like it again
What's wrong: The user will receive notification for every one of your likes. If they reload the page after unlike, the notification will disappear but will come back again after another like. You can like-unlike the status and spam someone's notifications.
The same is for repeat-unrepeat-repeat notifications.
In 042852ec relevant tests were added, but when I replaced TwitterAPI
references with CommonAPI
ones in the notification test, they stopped working because had been written incorrectly.
Please check out !1382 (closed) for changed tests.
Also I've added new checks to https://git.pleroma.social/pleroma/pleroma/blob/develop/lib/pleroma/notification.ex that should skip next notifications, but we erase previous ones in ActivityPub.unlike/4
/ActivityPub.unannounce/4
, so it doesn't work.