From: jim@gonzul.net (Jim Cheetham)
Subject: [sup-talk] sent_source - singular or per-account?
Date: Thu, 2 Jul 2009 22:14:23 +1200 [thread overview]
Message-ID: <f4cc59760907020314o60100e01r1a1f8af4d354030a@mail.gmail.com> (raw)
In-Reply-To: <1246502666-sup-1295@ntdws12.chass.utoronto.ca>
On Thu, Jul 2, 2009 at 3:17 PM, Ben Walton<bwalton at artsci.utoronto.ca> wrote:
> Excerpts from Jim Cheetham's message of Wed Jul 01 22:30:25 -0400 2009:
> If I'm understanding you correctly, you want to write to a different
> source depending on which address is used in the From.
Almost; what I (could have) said was that I wanted to write to a
different source depending on which account is in use for the current
message; I wasn't fixating on the From address itself, although with a
better understanding of the code you might declare that they are
effectively the same anyway :-)
> ?You'd either
> need to make a separate config entry in each account that gets setup
> (similar to the sendmail that you note) or provide the ability for the
> user to select the sent box in some other way.
Yes; and in either case I think we can't just override the current
global sent_source, because this is being used to read messages from,
in order to include them in the threads.
> In the 'simpler' case where the decision is made based on account
> used, you've got a chunk of static code making the choice and
> defaulting as it would now. ?The hook would simply take the place of
> the static decision maker. ?The decision has to be made per message
> regardless of how it's implemented, so doing it in a hook is a better
> option, imo. ?The Hook route would be slightly slower, since there are
> extra activation records on the stack for the function calls, but it
> should be negligible.
Mmm, I think the hook route would expose you to a lot of change,
because whenever a 'new' source (i.e. one not known about as load
time) is declared in the hook, you'll have to remember it so it can be
included in the index, and be available next time sup starts too.
Whereas requiring sent_sources to be declared at load time only means
they can be added as sources just like the current singular one is.
I've been browsing the source this evening, I don't have a very good
grasp of Ruby idiom but I do find it to be very readable in general
:-) However, I've come to a halt in SentManager.write_sent_message,
because I haven't figured out how @source.store_message relates to my
store URI, and therefore the relevant store_message function. I mean,
if :sent_store: is configured, how does @source get created from
@source_uri?
If we have multiple sent_sources, that contradicts the singleton
SentManager, unless @source becomes a hash keyed off from_email ... at
which point I'm pushing my Ruby skills too far for the evening.
Any comments or specific code pointers welcomed! I'd be happy to
attempt a patch for this, but I may need a little help ...
-jim
next prev parent reply other threads:[~2009-07-02 10:14 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-01 9:48 Jim Cheetham
2009-07-01 19:39 ` Ben Walton
2009-07-02 2:30 ` Jim Cheetham
2009-07-02 3:17 ` Ben Walton
2009-07-02 10:14 ` Jim Cheetham [this message]
2009-07-02 14:02 ` Ben Walton
2010-01-04 18:55 ` Bryan Richardson
2010-01-05 21:51 ` William Morgan
2010-01-06 19:18 ` Bryan Richardson
2010-01-06 19:29 ` William Morgan
2010-01-06 21:04 ` Tero Tilus
2010-01-06 21:23 ` William Morgan
2010-01-07 15:58 ` Tero Tilus
2010-01-08 16:00 ` Bryan Richardson
2010-01-09 22:47 ` Tero Tilus
2010-01-12 21:38 ` Bryan Richardson
2010-01-12 23:10 ` Tero Tilus
2010-01-04 20:50 ` Tero Tilus
2010-01-08 23:06 ` Kevin Riggle
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=f4cc59760907020314o60100e01r1a1f8af4d354030a@mail.gmail.com \
--to=jim@gonzul.net \
/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