File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -118,14 +118,12 @@ public function _init()
118
118
/** @var Entity $this */
119
119
if ($ plugin ->getSpamTerms ($ this , $ plugin ->config ['termsBlock ' ])) {
120
120
$ this ->spamBlock = true ;
121
- $ this ->setStatus (-10 );
122
121
}
123
122
});
124
123
125
124
// Verifica se existem termos maliciosos e dispara o e-mail e a notificação
126
- $ app ->hook ("entity(<< {$ hooks }>>).save:after " , function () use ($ plugin , $ last_spam_sent ) {
125
+ $ app ->hook ("entity(<< {$ hooks }>>).save:after " , function () use ($ plugin , $ last_spam_sent, $ app ) {
127
126
/** @var Entity $this */
128
-
129
127
$ users = $ plugin ->getAdminUsers ($ this );
130
128
$ terms = array_merge ($ plugin ->config ['termsBlock ' ], $ plugin ->config ['terms ' ]);
131
129
@@ -151,6 +149,12 @@ public function _init()
151
149
$ notification ->message = $ message ;
152
150
$ notification ->save (true );
153
151
}
152
+
153
+ if ($ this ->spamBlock ) {
154
+ $ conn = $ app ->em ->getConnection ();
155
+ $ table = $ plugin ->dictTable ($ this );
156
+ $ conn ->executeQuery ("UPDATE {$ table } SET status = -10 WHERE id = {$ this ->id }" );
157
+ }
154
158
});
155
159
156
160
// Garante que o termo encontrado fique salvo e o e-mail seja disparado
You can’t perform that action at this time.
0 commit comments