<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,10 @@
-- plugins need callbacks, like on_join, etc.
+- need to catch timeout errors and do something sensible, like wait and retry the connection
+
+- need to catch no-network errors and return a sensible error message:
+
+/opt/local/lib/ruby/1.8/net/http.rb:560:in `initialize': Network is unreachable - connect(2) (Errno::ENETUNREACH)
+
+- plugins need callbacks, like on_join, bot_loaded, etc.
 
 - multi-room support
 </diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 # TODO
 #
 # - convert/filter out HTML entities like &amp;quot;
-# - do the right thing when a paste occurs (remove the 'view paste' but keep the content)
+# - add a callback to prime the chains when the bot is ready, and do this in a thread.
 
 class Boop &lt; CampfireBot::Plugin
   
@@ -11,17 +11,11 @@ class Boop &lt; CampfireBot::Plugin
   on_command 'speak',             :random_chatter
   on_command 'prime_chains',      :load_transcripts
   
-  on_command 'test',              :debug
-  
   def initialize
     @phrases    = Hash.new { |hash, key| hash[key] = [] } # phrase =&gt; next-word possibilities
     @word_count = 0
   end
-  
-  def debug
-    p @phrases
-  end
-  
+
   def listen(msg)
     add_line(msg[:message])
   end
@@ -49,9 +43,10 @@ class Boop &lt; CampfireBot::Plugin
         puts &quot;message: #{message[:message]}&quot;
         
         filtered_text = strip_message(message)
-        add_line(filtered_text.gsub(/([^\.])$/, '\1.')) unless filtered_text.blank?
         
-        puts &quot;ACCEPTED: &quot; + filtered_text.gsub(/([^\.])$/, '\1.') unless filtered_text.blank?
+        filtered_text.split(&quot;\n&quot;).each { |line| add_line(line) unless line.blank? }
+        filtered_text.split(&quot;\n&quot;).each { |line| puts &quot;ACCEPTED: &quot; + line unless line.blank? }
+        
       end
     end
     
@@ -115,7 +110,9 @@ class Boop &lt; CampfireBot::Plugin
     
     # and get rid of the messages that are generated by the campfire system itself
     return '' if str =~ /has (entered|left) the room/
-    return '' if str =~ /^View paste/
+    
+    # keep the contents of the pastes, but strip out the 'view paste' link.
+    str.gsub!(/&lt;a href=.*?&gt;View paste&lt;\/a&gt;/, '')
     
     # also get rid of the stuff spoken by the bot
     return '' if msg[:person] == bot.config['nickname']</diff>
      <filename>plugins/boop.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9077b5a2d50e21ce2fe2f55a7e0eeff2ae52af04</id>
    </parent>
  </parents>
  <author>
    <name>Tim Riley</name>
    <email>tim@openmonkey.com</email>
  </author>
  <url>http://github.com/timriley/campfire-bot/commit/1b6de4d3325e4502c73a44d33eada21f1791d6c6</url>
  <id>1b6de4d3325e4502c73a44d33eada21f1791d6c6</id>
  <committed-date>2008-10-31T17:15:19-07:00</committed-date>
  <authored-date>2008-10-31T17:15:19-07:00</authored-date>
  <message>properly strip out the 'view paste' lines when priming markov chains; split multi-line messages into individual lines and ignore the blank ones</message>
  <tree>0562d42806e255a82b73247fef58d6cf24762e8c</tree>
  <committer>
    <name>Tim Riley</name>
    <email>tim@openmonkey.com</email>
  </committer>
</commit>
