<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -79,6 +79,6 @@ The snippets &quot;comments&quot;, &quot;comment&quot; and &quot;comment_form&quot; are created by the migrati
 * Keith Bingman
 * Sean Cribbs
 * Ryan Heneise
-* Frank Louwers
+* Frank Louwers (thanks to Jan De Poorter for the Mollom ruby lib)
 
 If you contribute, go ahead and add your name to the list! 
\ No newline at end of file</diff>
      <filename>README.rdoc</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,7 @@
 
 
 
+
 = DONE
 * Add text filter to comment body.
 * Remove scaffolding and improve admin interface. </diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,9 @@ class Comment &lt; ActiveRecord::Base
   
   before_save :auto_approve
   before_save :apply_filter
+  after_save  :save_mollom_servers
+    
+  MOLLOM_SERVER_CACHE = RAILS_ROOT + '/tmp/mollom_servers.yaml'
     
   def self.per_page
     50
@@ -13,15 +16,25 @@ class Comment &lt; ActiveRecord::Base
     self.author_ip = request.remote_ip
     self.user_agent = request.env['HTTP_USER_AGENT']
     self.referrer = request.env['HTTP_REFERER']
- #   self.xff = request.env['HTTP_X_FORWARDED_FOR']
   end
   
   def akismet
     @akismet ||= Akismet.new(Radiant::Config['comments.akismet_key'], Radiant::Config['comments.akismet_url'])
   end
   
+  def save_mollom_servers
+    File.open(MOLLOM_SERVER_CACHE,'w') do |f|
+      f.write mollom.server_list.to_yaml
+    end
+  end
+  
   def mollom
+    return @mollom if @mollom
     @mollom ||= Mollom.new(:private_key =&gt; Radiant::Config['comments.mollom_privatekey'], :public_key =&gt; Radiant::Config['comments.mollom_publickey'])
+    if (File.exists?(MOLLOM_SERVER_CACHE))
+      @mollom.server_list = YAML::load(File.read(MOLLOM_SERVER_CACHE))
+    end    
+    @mollom
   end
   
   # If the Akismet details are valid, and Akismet thinks this is a non-spam</diff>
      <filename>app/models/comment.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2cd81d2c68b0d2d5811a44d1ed409d734dfdaec9</id>
    </parent>
  </parents>
  <author>
    <name>franklouwers</name>
    <email>frank@openminds.be</email>
  </author>
  <url>http://github.com/franklouwers/radiant-comments/commit/4e0576c39d619d8f6873c3b704f9ecc56345a742</url>
  <id>4e0576c39d619d8f6873c3b704f9ecc56345a742</id>
  <committed-date>2008-09-23T09:40:30-07:00</committed-date>
  <authored-date>2008-09-23T09:40:30-07:00</authored-date>
  <message>Implementing caching of the Mollom servers</message>
  <tree>75722307af077f20eed4a2bf07768d13c5a622c4</tree>
  <committer>
    <name>franklouwers</name>
    <email>frank@openminds.be</email>
  </committer>
</commit>
