public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
On the comments page, sort the comments by the spam engine's wishes.

By default, the comments are in date order.
francois (author)
Mon Mar 03 10:42:24 -0800 2008
commit  a27e961912a2338249258d7f838aef484de01365
tree    83658456e86c112c632aac90545403584865ef92
parent  8d42449ffbd49f4dbe71c5f03546dd684e2e38f3
...
28
29
30
 
31
32
33
...
28
29
30
31
32
33
34
0
@@ -28,6 +28,7 @@ public
0
         when 'unapproved' then :unapproved_comments
0
         else :all_comments
0
       end
0
+ @comments = @comments.sort_by(&@site.spam_engine.sort_block)
0
   end
0
   
0
   def unapproved
...
31
32
33
 
 
 
 
 
34
35
36
...
31
32
33
34
35
36
37
38
39
40
41
0
@@ -31,6 +31,11 @@ module Mephisto
0
         false
0
       end
0
 
0
+ # The default sort order is the original order.
0
+ def sort_block
0
+ lambda {|c| 0}
0
+ end
0
+
0
       # Returns a fully formed HTML fragment that renders statistics on this
0
       # engine's performance.
0
       def statistics_template
...
61
62
63
 
 
 
 
64
65
66
...
61
62
63
64
65
66
67
68
69
70
0
@@ -61,6 +61,10 @@ module Mephisto
0
         defensio.report_false_negatives(:signatures => [comment.spam_engine_data[:signature]])
0
       end
0
 
0
+ def sort_block
0
+ lambda {|c| 1.0 - (c.spam_engine_data[:spaminess] || 0)}
0
+ end
0
+
0
       def errors
0
         returning([]) do |es|
0
           es << "The Defensio key is missing" if options[:defensio_key].blank?

Comments

    No one has commented yet.