From: Daniel Schoepe <daniel.schoepe@googlemail.com>
To: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] [patch] Add crypto_selector variable to before-edit
Date: Tue, 26 Jan 2010 16:55:55 +0100 [thread overview]
Message-ID: <1264521165-sup-9898@nemesis.home> (raw)
In-Reply-To: <1264251144-sup-4056@masanjin.net>
[-- Attachment #1.1.1: Type: text/plain, Size: 274 bytes --]
Excerpts from William Morgan's message of Sat Jan 23 13:53:04 +0100 2010:
> Hi Daniel,
>
> I like the idea, but would prefer a dedicated "crypto-mode" hook
> analogous to how we have the "reply-to" hook for setting the default
> reply-to mode.
Okay, here's the new patch:
[-- Attachment #1.1.2: 0001-Added-crypto-settings-hook.patch --]
[-- Type: application/octet-stream, Size: 1449 bytes --]
From 3226e89b09f166e55ed36721aa42ad59c6dddc09 Mon Sep 17 00:00:00 2001
From: Daniel Schoepe <daniel.schoepe@googlemail.com>
Date: Tue, 26 Jan 2010 16:45:16 +0100
Subject: [PATCH] Added crypto-settings hook
---
lib/sup/modes/edit-message-mode.rb | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/lib/sup/modes/edit-message-mode.rb b/lib/sup/modes/edit-message-mode.rb
index 8849271..88f3734 100644
--- a/lib/sup/modes/edit-message-mode.rb
+++ b/lib/sup/modes/edit-message-mode.rb
@@ -40,6 +40,18 @@ Return value:
none
EOS
+ HookManager.register "crypto-mode", <<EOS
+Modifies cryptography settings based on header and message content, before
+editing a new message. This can be used to set, for example, default cryptography
+settings.
+Variables:
+ header: a hash of headers. See 'signature' hook for documentation.
+ body: an array of lines of body text.
+ crypto_selector: the UI element that controls the current cryptography setting.
+Return value:
+ none
+EOS
+
attr_reader :status
attr_accessor :body, :header
bool_reader :edited
@@ -92,6 +104,9 @@ EOS
add_selector @crypto_selector if @crypto_selector
HookManager.run "before-edit", :header => @header, :body => @body
+ if @crypto_selector
+ HookManager.run "crypto-mode", :header => @header, :body => @body, :crypto_selector => @crypto_selector
+ end
super opts
regen_text
--
1.6.6
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 140 bytes --]
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
next prev parent reply other threads:[~2010-01-26 16:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-18 14:32 Daniel Schoepe
2010-01-23 12:53 ` William Morgan
2010-01-24 11:10 ` Carlos Garcia Campos
2010-01-26 15:55 ` Daniel Schoepe [this message]
2010-01-26 18:19 ` Ben Walton
2010-02-27 18:17 ` Rich Lane
2010-03-09 10:29 ` Gaute Hope
2010-03-12 22:03 ` Daniel Schoepe
2010-03-12 22:34 ` 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=1264521165-sup-9898@nemesis.home \
--to=daniel.schoepe@googlemail.com \
--cc=sup-talk@rubyforge.org \
/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