Skip to content

Commit

Permalink
Trocado o hook before pelo finish para salvar os termos e disparar o …
Browse files Browse the repository at this point in the history
…e-mail ao mover usuário para lixeira Ref.: #1
  • Loading branch information
israelmelo committed Sep 3, 2024
1 parent bf298a1 commit 56e71ac
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,11 @@ public function _init()
}
});

// Garante que o agente fique em rascunho caso exista termos detectados
$app->hook("entity(<<{$hooks}>>).save:before", function () use ($plugin, $app) {
// Garante que o termo encontrado fique salvo e o e-mail seja disparado
$app->hook("entity(<<{$hooks}>>).save:finish", function () use ($plugin, $app) {
/** @var Entity $this */
if($plugin->getSpamTerms($this, $plugin->config['termsBlock'])) {
$this->setStatus(0);
$this->spamBlock = true;
$this->user->setStatus(-10);
}
});

Expand Down

0 comments on commit 56e71ac

Please sign in to comment.