Commit d743080409ff7c683678161dc97ed77daf9096f6
1 parent
a94eb160
Exists in
master
and in
28 other branches
[spaminator] marking possible enhancements
Showing
1 changed file
with
5 additions
and
0 deletions
Show diff stats
plugins/anti_spam/lib/anti_spam_plugin/spaminator.rb
| @@ -72,6 +72,8 @@ class AntiSpamPlugin::Spaminator | @@ -72,6 +72,8 @@ class AntiSpamPlugin::Spaminator | ||
| 72 | # TODO several comments with the same content: | 72 | # TODO several comments with the same content: |
| 73 | # → disable author | 73 | # → disable author |
| 74 | # → mark all of them as spam | 74 | # → mark all of them as spam |
| 75 | + | ||
| 76 | + # TODO check comments that contains URL's | ||
| 75 | end | 77 | end |
| 76 | 78 | ||
| 77 | def process_person(person) | 79 | def process_person(person) |
| @@ -92,6 +94,7 @@ class AntiSpamPlugin::Spaminator | @@ -92,6 +94,7 @@ class AntiSpamPlugin::Spaminator | ||
| 92 | # → mark their comments as spam | 94 | # → mark their comments as spam |
| 93 | # | 95 | # |
| 94 | Person.where(:environment_id => @environment.id).where(['created_at < ?', Time.now - 1.month]).find_each do |person| | 96 | Person.where(:environment_id => @environment.id).where(['created_at < ?', Time.now - 1.month]).find_each do |person| |
| 97 | + # TODO progress indicator - see process_all_people above | ||
| 95 | number_of_friends = person.friends.count | 98 | number_of_friends = person.friends.count |
| 96 | number_of_communities = person.communities.count | 99 | number_of_communities = person.communities.count |
| 97 | if number_of_friends == 0 && number_of_communities <= 1 | 100 | if number_of_friends == 0 && number_of_communities <= 1 |
| @@ -104,6 +107,8 @@ class AntiSpamPlugin::Spaminator | @@ -104,6 +107,8 @@ class AntiSpamPlugin::Spaminator | ||
| 104 | end | 107 | end |
| 105 | 108 | ||
| 106 | def mark_as_spammer(person) | 109 | def mark_as_spammer(person) |
| 110 | + # FIXME create an AbuseComplaint and finish instead of calling | ||
| 111 | + # Person#disable directly | ||
| 107 | person.disable | 112 | person.disable |
| 108 | end | 113 | end |
| 109 | 114 |