From: Marcus Williams Date: Tue, 15 Jan 2008 09:40:04 +0000 (+0000) Subject: Added quoteline hook for reply mode X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=e46eb6be10617eb75cbc426de82f9f7e49d921bc;p=sup Added quoteline hook for reply mode This hook allows a user to configure a quote line for replies. The default is the standard sup quote line "Excerpts from...". Multiple lines are allowed. --- diff --git a/lib/sup/modes/reply-mode.rb b/lib/sup/modes/reply-mode.rb index 04018e3..2d05f15 100644 --- a/lib/sup/modes/reply-mode.rb +++ b/lib/sup/modes/reply-mode.rb @@ -10,6 +10,14 @@ class ReplyMode < EditMessageMode :user => "Customized" } + HookManager.register "quoteline", < #{l}" } + quoteline = HookManager.run("quoteline", :message => m) || default_quoteline(m) + lines = quoteline.split("\n") + m.quotable_body_lines.map { |l| "> #{l}" } lines.pop while lines.last =~ /^\s*$/ lines end + def default_quoteline m + "Excerpts from #{@m.from.name}'s message of #{@m.date}:" + end + def handle_new_text new_header, new_body old_header = @headers[@type_selector.val] if new_header.size != old_header.size || old_header.any? { |k, v| new_header[k] != v }