[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



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
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk