Discussions of development and use of the Sup email client
 help / color / mirror / Atom feed
From: Ruthard Baudach <ruthard.baudach@web.de>
To: supmua <supmua@googlegroups.com>
Subject: Re: [sup] Re: how to write interactive hook
Date: Wed, 01 Oct 2014 22:46:06 +0200	[thread overview]
Message-ID: <1412196341-sup-9170@ruthard-lappi> (raw)
In-Reply-To: <1411319662-astroid-1-fmtkb2haww-21321@strange>


[-- Attachment #1.1: Type: text/plain, Size: 2397 bytes --]

>== Auszüge aus der Nachricht von  Gaute Hope vom 2014-09-21 19:20:
> 
> Another option is to pass the message id (if it is persistent) to the
> signature hook, then when the message id changes you reset the hook
> state.

Great idea! I managed to do so -- see attached patch.
If you would decide to add this to main sup, I would publish my
signature hook in the wiki.

Best regards,

Ruthard

it works :-)
vvv see down here vvv

-- 

Dr. Ruthard Baudach
Speckertsweg 36a
97209 Veitshöchheim
----

Emails sind Postkarten!
Deshalb bitte Emails verschlüsseln und signieren.
Mein öffentlicher Schlüssel:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2

mQENBFPcu+kBCADC5zwexQDbXfuv7fH4epJ6EJSqYPMzm867YHZZBiYO0EQPgXFp
MBFEMRz0/HX8Roi3oeQNA01Bo4J6HzxcOqDXHLMQBfbiOsaQZFm73TotZUNDB9b6
kPTHFY33fnoJbTf9lcD8sOM4lZBcFKRumIKJP+IKhN2PFml0nTMBGoWgjmK/xP5F
7SvZO+Hy9uLvnzPMTTURrpUhJPba6mhPzX+IrDd6EfollXHk5aeYJ/b+XRFmWHPm
B3HemLigYDMcvW2zzpK0cmGcxaBWE5pmguhYywibyP5AMsUQCgOfWLW/OCm8QWoL
E3TMvWEc2luJT4FZ8jLbK5CWhdCvlqjwsbqhABEBAAG0KFJ1dGhhcmQgQmF1ZGFj
aCA8cnV0aGFyZC5iYXVkYWNoQHdlYi5kZT6JAT8EEwECACkFAlPcu+kCGwMFCQPC
ZwAHCwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRAPOdocrFrGw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dnv8b2Z+7cIO82qJmcfbdSYcfNC2KJHZn
Nc2DAQ==
=EfIc
-----END PGP PUBLIC KEY BLOCK-----

[-- Attachment #1.2: 0001-ge-ndert-lib-sup-modes-edit_message_mode.rb.patch --]
[-- Type: application/octet-stream, Size: 1673 bytes --]

From dc36797a150c8e94589fcaea9aa556feddfe8205 Mon Sep 17 00:00:00 2001
From: Ruthard Baudach <rthrd@web.de>
Date: Wed, 1 Oct 2014 22:21:24 +0200
Subject: [PATCH] =?UTF-8?q?=09ge=C3=A4ndert:=20=20=20=20=20=20=20lib/sup/m?=
 =?UTF-8?q?odes/edit=5Fmessage=5Fmode.rb=20=09=09=09pass=20message=5Fid=20?=
 =?UTF-8?q?to=20signature=20hook?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/sup/modes/edit_message_mode.rb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/sup/modes/edit_message_mode.rb b/lib/sup/modes/edit_message_mode.rb
index 2b8b590..57f75aa 100644
--- a/lib/sup/modes/edit_message_mode.rb
+++ b/lib/sup/modes/edit_message_mode.rb
@@ -19,7 +19,8 @@ Variables:
       header: an object that supports string-to-string hashtable-style access
               to the raw headers for the message. E.g., header["From"],
               header["To"], etc.
-  from_email: the email part of the From: line, or nil if empty
+  from_email: the email part of the From: line, or nil if empty
+  message_id: the unique message id of the message
 Return value:
   A string (multi-line ok) containing the text of the signature, or nil to
   use the default signature, or :none for no signature.
@@ -688,7 +689,7 @@ private
     from_email = p && p.email
 
     ## first run the hook
-    hook_sig = HookManager.run "signature", :header => @header, :from_email => from_email
+    hook_sig = HookManager.run "signature", :header => @header, :from_email => from_email, :message_id => @message_id
 
     return [] if hook_sig == :none
     return ["", "-- "] + hook_sig.split("\n") if hook_sig
-- 
2.1.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2014-10-01 20:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-14 18:07 Ruthard Baudach
2014-09-17 18:46 ` [sup] " Matthieu Rakotojaona
2014-09-18  5:51   ` Gaute Hope
2014-09-18 17:46   ` Ruthard Baudach
2014-09-18 18:58     ` Gaute Hope
2014-09-18  9:34 ` Eric Weikl
2014-09-18 20:06 ` Ruthard Baudach
2014-09-18 20:15 ` Ruthard Baudach
2014-09-18 21:10   ` [sup] " Gaute Hope
2014-09-19 18:41     ` Ruthard Baudach
2014-09-21 17:20       ` Gaute Hope
2014-10-01 20:46         ` Ruthard Baudach [this message]
2014-10-06 12:05           ` Gaute Hope

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1412196341-sup-9170@ruthard-lappi \
    --to=ruthard.baudach@web.de \
    --cc=supmua@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox