From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.228.134 with SMTP id je6cs218625icb; Mon, 3 Jan 2011 11:53:00 -0800 (PST) Received: by 10.147.171.3 with SMTP id y3mr30233532yao.34.1294084380072; Mon, 03 Jan 2011 11:53:00 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id k9si15438130vbp.57.2011.01.03.11.52.59; Mon, 03 Jan 2011 11:53:00 -0800 (PST) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 42A281678325; Mon, 3 Jan 2011 14:52:59 -0500 (EST) Received: from gateway0.EECS.Berkeley.EDU (gateway0.EECS.Berkeley.EDU [169.229.60.87]) by rubyforge.org (Postfix) with ESMTP id 180841858379 for ; Mon, 3 Jan 2011 14:34:02 -0500 (EST) Received: from samurai.icir.org (samurai.ICIR.org [192.150.187.48]) (authenticated bits=0) by gateway0.EECS.Berkeley.EDU (8.14.4/8.13.5) with ESMTP id p03JY0AP001433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Mon, 3 Jan 2011 11:34:01 -0800 (PST) From: Matthias Vallentin To: Sup Talk Date: Mon, 03 Jan 2011 11:34:00 -0800 Message-Id: <1294082627-sup-4287@samurai.icir.org> User-Agent: Sup/git Subject: [sup-talk] Multiple execution of before-edit hook X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org 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