commit ee84f2b7cb7192b6bebaea192ff78e024139faf6
parent f24e54e0da3fb96f8a2e6543521a774189deadc8
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Mon, 21 Jan 2008 18:45:58 -0800
Merge branch 'quoteline' into next
Diffstat:
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lib/sup/modes/reply-mode.rb b/lib/sup/modes/reply-mode.rb
@@ -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