Subject: [sup-talk] Multiple execution of before-edit hook

From: Matthias Vallentin <[email-masked]>
Date: Mon, 03 Jan 2011 11:34:00 -0800

I noticed that before-edit is executed several times when replying:

    @headers.each do |k, v|
      @bodies[k] = body
      HookManager.run "before-edit", :header => v, :body => @bodies[k]
    end

What's the rational behind this? Why not invoking the hook once, for all
headers and the body. (Also, the hook is executed again in the parent
class EditMessageMode.) Since I use the hook to append some text at the
end of the body

    body << "foo"

the text is added multiple times. Currently I use a crude hack to avoid
the duplicate appending by

    body << "foo" unless body.last == "foo"

but I wonder whether this behavior is intentional.

    Matthias
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk