[Sprint/PinkPanther](fix): Delete activity after moderation queue rejection #504
Closes #504
Summary
On production right now, if you reject a post in a group you moderate, the post no longer appears in the queue, but still shows up in the feed for mods only like so:
Testing
- Make a group, make it moderated.
- Login to a secondary account, create posts numbered 1, 2, 3, 4, 5.
- Log-in to primary account, look at the group, see the posts with "awaiting moderation"
- Go to the moderation queue and reject the post numbered 3.
- Check that the activity with the content '3' is not visible on the feed with its "awaiting moderation"
0/4
threads resolved
added scoped labels
added 69 commits
-
52f5c842...a8a3fed6 - 68 commits from branch
master
- 009351e2 - Merge branch 'master' of gitlab.com:minds/engine into fix/delete-activity-mod-queue-504
-
52f5c842...a8a3fed6 - 68 commits from branch
7 /** 8 * Class PropagateRejection 9 * 10 * Propagates activity deletion from the group feed after rejection. 11 * @package Minds\Core\Groups\Delegates 12 * @author Ben Hayward 13 */ 14 class PropagateRejection 15 { 16 /** 17 * Deletes an activity associated with a rejected post. 18 * 19 * @param string $guid - activity guid. 20 * @return boolean - whether deletion was successful 21 */ 22 public function deleteActivity($guid): bool - Owner
delegate should be void
1 <?php 2 3 namespace Minds\Core\Groups\Delegates; 4 5 use Minds\Entities\Activity; 6 7 /** 8 * Class PropagateRejection 9 * 10 * Propagates activity deletion from the group feed after rejection. 11 * @package Minds\Core\Groups\Delegates 12 * @author Ben Hayward 13 */ 14 class PropagateRejection - Owner
Can you name class PropagateRejectionDelegate?
217 222 $this->sendNotification('reject', $activity); 218 223 } 219 224 225 $this->propagateRejection->deleteActivity($activity->guid); - Owner
Delegates should have context as to their parent functions. Ideally this function would be called
onReject
and pass through the entire object, not just the guid.
10 * Propagates activity deletion from the group feed after rejection. 11 * @package Minds\Core\Groups\Delegates 12 * @author Ben Hayward 13 */ 14 class PropagateRejection 15 { 16 /** 17 * Deletes an activity associated with a rejected post. 18 * 19 * @param string $guid - activity guid. 20 * @return boolean - whether deletion was successful 21 */ 22 public function deleteActivity($guid): bool 23 { 24 $activity = new Activity($guid); 25 return $activity->delete(); - Owner
Core\Entities\Actions\Delete
should be used instead.
added scoped label and automatically removed label