]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/ActivitySpam/scripts/silencespammer.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / plugins / ActivitySpam / scripts / silencespammer.php
index dfa9335587148e3fcc8197c2030a01f4af77d6d8..4e710d10a7bac3735dbcef765fd442947eae4ebc 100644 (file)
@@ -31,7 +31,7 @@ Users who post a lot of spam get silenced
   -a --all      All users
 END_OF_SILENCESPAMMER_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 function testAllUsers($filter, $minimum, $percent) {
     $found = false;
@@ -64,7 +64,7 @@ function silencespammer($filter, $user, $minimum, $percent) {
 
     printfnq("Testing user %s\n", $user->nickname);
 
-    $profile = Profile::staticGet('id', $user->id);
+    $profile = Profile::getKV('id', $user->id);
 
     if ($profile->isSilenced()) {
        printfnq("Already silenced %s\n", $user->nickname);
@@ -82,7 +82,7 @@ function silencespammer($filter, $user, $minimum, $percent) {
 
     $ss->query(sprintf("SELECT count(*) as spam_count ".
                        "FROM notice join spam_score on notice.id = spam_score.notice_id ".
-                       "WHERE notice.profile_id = %d", $profile->id));
+                       "WHERE notice.profile_id = %d AND spam_score.is_spam = 1", $profile->id));
 
     while ($ss->fetch()) {
         $spam_count = $ss->spam_count;