Skip to content
Commits on Source (4)
Your channel has been banned because it was determined to violate our Content Policy: 3 strikes. Due to this violation, your channel has been banned from Minds. To appeal this decision, you may [log in](https://www.minds.com/) and appeal any individual strike offense to a jury of your peers. If a strike gets removed, the ban will be lifted. More can be learned about how the Appeals process works [here](https://www.minds.com/content-policy).
Your channel has been banned because it was determined to violate our Content Policy. Due to this violation, your channel has been banned. To appeal this decision, please reply to this email. More can be learned about how the Appeals process works [here](https://www.minds.com/content-policy).
......@@ -69,7 +69,7 @@ class Repository
$skip = false;
switch ($opts['state']) {
case 'review':
if ($report->getState() != 'initial_jury_decided') {
if ($report->getState() != 'initial_jury_decided' || $report->isUpheld() === false) {
$skip = true;
}
break;
......
......@@ -23,7 +23,7 @@ class TotalOverturnedAggregate implements ModerationStatsAggregateInterface
$statement = "SELECT count(*) as total FROM moderation_reports_by_state
WHERE state IN ('appeal_jury_decided')
AND timestamp > ?
AND uphold = true
AND uphold = false
ALLOW FILTERING";
$values = [ new Timestamp(strtotime('-30 days', time())) ];
......
......@@ -20,7 +20,7 @@ class NotificationDelegate
public function onAction(UserReport $userReport)
{
$message = "Thanks for your report, and for making Minds a safer place";
$message = "Thank you for submitting your report. The reported content or channel will be reviewed as soon as possible.";
$this->dispatcher->trigger('notification', 'all', [
'to' => [$userReport->getReporterGuid()],
'from' => 100000000000000519,
......
......@@ -29,12 +29,16 @@ class ActionDelegate
/** @var StrikesManager $strikesManager */
private $strikesManager;
/** @var EmailDelegate $emailDelegate */
private $emailDelegate;
public function __construct(
$entitiesBuilder = null,
$actions = null,
$urn = null,
$strikesManager = null,
$saveAction = null
$saveAction = null,
$emailDelegate = null
)
{
$this->entitiesBuilder = $entitiesBuilder ?: Di::_()->get('EntitiesBuilder');
......@@ -42,6 +46,7 @@ class ActionDelegate
$this->urn = $urn ?: new Urn;
$this->strikesManager = $strikesManager ?: Di::_()->get('Moderation\Strikes\Manager');
$this->saveAction = $saveAction ?: new SaveAction;
$this->emailDelegate = $emailDelegate ?: new EmailDelegate;
}
public function onAction(Verdict $verdict)
......@@ -217,6 +222,8 @@ class ActionDelegate
$user->banned = 'yes';
$user->ban_reason = implode('.', [ $report->getReasonCode(), $report->getSubReasonCode() ]);
$user->save();
$this->emailDelegate->onBan($report);
}
}
<?php
/**
* Email Notification delegate for Verdicts
*/
namespace Minds\Core\Reports\Verdict\Delegates;
use Minds\Core\Di\Di;
use Minds\Core\Reports\Report;
use Minds\Core\Events\EventsDispatcher;
use Minds\Common\Urn;
use Minds\Core\Email\Campaigns\Custom;
class EmailDelegate
{
/** @var Custom $campaign */
protected $campaign;
/** @var EntitiesBuilder $entitiesBuilder */
protected $entitiesBuilder;
/** @var Urn $urn */
public function __construct($campaign = null, $entitiesBuilder = null, $urn = null)
{
$this->campaign = $campaign ?: new Custom;
$this->entitiesBuilder = $entitiesBuilder ?: Di::_()->get('EntitiesBuilder');
$this->urn = $urn ?: new Urn;
}
/**
* On Action
* @param Report $report
* @return void
*/
public function onBan(Report $report)
{
$entityUrn = $report->getEntityUrn();
$entityGuid = $this->urn->setUrn($entityUrn)->getNss();
$entity = $this->entitiesBuilder->single($entityGuid);
$owner = $entity->type === 'user' ? $entity : $this->entitiesBuilder->single($entity->getOwnerGuid());
$type = $entity->type;
if ($type === 'object') {
$type = $entity->subtype;
}
$template = 'moderation-banned.md';
$action = 'removed';
switch ($report->getReasonCode()) {
case 2:
return;
break;
case 4:
case 8:
$template = 'moderation-3-strikes.md';
break;
}
$this->campaign->setUser($owner);
$this->campaign->setTemplate($template);
$this->campaign->setSubject('You have been banned');
$this->campaign->setVars([
'type' => $type,
'action' => $action,
//'reason' => $reason,
]);
$this->campaign->send();
}
}