]> git.cworth.org Git - sup/commitdiff
renamed "quoteline" hook to "attribution"
authorGrant Hollingworth <grant@antiflux.org>
Thu, 17 Jan 2008 17:49:21 +0000 (12:49 -0500)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 22 Jan 2008 02:44:36 +0000 (18:44 -0800)
lib/sup/modes/reply-mode.rb

index 2d05f15208de168aa7ad1e41dc0a4a75791839cb..3b8c920142fe00c57fc4f7369a14da620949ff25 100644 (file)
@@ -10,10 +10,11 @@ class ReplyMode < EditMessageMode
     :user => "Customized"
   }
 
-  HookManager.register "quoteline", <<EOS
-Generates a quote line "On 1/4/2007, Joe Bloggs wrote:".
+  HookManager.register "attribution", <<EOS
+Generates an attribution ("Excerpts from Joe Bloggs's message of Fri Jan 11 09:54:32 -0500 2008:").
 Variables:
-      message: A message object representing the message being replied to
+  message: a message object representing the message being replied to
+    (useful values include message.from.name and message.date)
 Return value:
   A string containing the text of the quote line (can be multi-line)
 EOS
@@ -123,13 +124,13 @@ protected
   end
 
   def reply_body_lines m
-    quoteline = HookManager.run("quoteline", :message => m) || default_quoteline(m)
-    lines = quoteline.split("\n") + m.quotable_body_lines.map { |l| "> #{l}" }
+    attribution = HookManager.run("attribution", :message => m) || default_attribution(m)
+    lines = attribution.split("\n") + m.quotable_body_lines.map { |l| "> #{l}" }
     lines.pop while lines.last =~ /^\s*$/
     lines
   end
 
-  def default_quoteline m
+  def default_attribution m
     "Excerpts from #{@m.from.name}'s message of #{@m.date}:"
   end