[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-27 Thread Austin Clements
Quoth Daniel Kahn Gillmor on Dec 27 at 9:27 am: > On 12/23/2011 10:45 PM, Austin Clements wrote: > > Quoth Dmitry Kurochkin on Dec 10 at 3:25 am: > >> + /* For some reason the GMimeSignatureValidity returned > >> +* here is not a const (inconsistent with that > >> +

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-27 Thread Daniel Kahn Gillmor
On 12/23/2011 10:45 PM, Austin Clements wrote: > Quoth Dmitry Kurochkin on Dec 10 at 3:25 am: >> + /* For some reason the GMimeSignatureValidity returned >> +* here is not a const (inconsistent with that >> +* returned by >> +*

Re: [PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-27 Thread Daniel Kahn Gillmor
On 12/23/2011 10:45 PM, Austin Clements wrote: Quoth Dmitry Kurochkin on Dec 10 at 3:25 am: + /* For some reason the GMimeSignatureValidity returned +* here is not a const (inconsistent with that +* returned by +*

Re: [PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-27 Thread Austin Clements
Quoth Daniel Kahn Gillmor on Dec 27 at 9:27 am: On 12/23/2011 10:45 PM, Austin Clements wrote: Quoth Dmitry Kurochkin on Dec 10 at 3:25 am: + /* For some reason the GMimeSignatureValidity returned +* here is not a const (inconsistent with that +*

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-23 Thread Austin Clements
Quoth Jameson Graef Rollins on Dec 10 at 1:17 pm: > On Sat, 10 Dec 2011 03:25:48 +0400, Dmitry Kurochkin gmail.com> wrote: > > + out->is_encrypted = TRUE; > > + out->is_signed = TRUE; > > > > These are set only if we do decryption/verification. But their > > names and

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-23 Thread Austin Clements
Thanks for the thorough review! Quoth Dmitry Kurochkin on Dec 10 at 3:25 am: > Hi Austin. > > +/* The number of children of this part. */ > +int children; > > Consider renaming to children_count or similar to make it clear that it > is a counter and not the actual children. Good

Re: [PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-23 Thread Austin Clements
Thanks for the thorough review! Quoth Dmitry Kurochkin on Dec 10 at 3:25 am: Hi Austin. +/* The number of children of this part. */ +int children; Consider renaming to children_count or similar to make it clear that it is a counter and not the actual children. Good point.

Re: [PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-23 Thread Austin Clements
Quoth Jameson Graef Rollins on Dec 10 at 1:17 pm: On Sat, 10 Dec 2011 03:25:48 +0400, Dmitry Kurochkin dmitry.kuroch...@gmail.com wrote: + out-is_encrypted = TRUE; + out-is_signed = TRUE; These are set only if we do decryption/verification. But their names and

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-10 Thread Jameson Graef Rollins
On Fri, 9 Dec 2011 14:54:26 -0500, Austin Clements wrote: > +/* Handle PGP/MIME parts */ > +if (GMIME_IS_MULTIPART_ENCRYPTED (part) && out->ctx->decrypt) { > + if (out->children != 2) { > + /* this violates RFC 3156 section 4, so we won't bother with it. */ > +

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-10 Thread Jameson Graef Rollins
On Sat, 10 Dec 2011 03:25:48 +0400, Dmitry Kurochkin wrote: > +notmuch_bool_t decrypt_success; > > Perhaps s/decrypt_success/is_decrypted/ for consistency with > is_encrypted? This difference doesn't seem so bad to me, since the is_ variables point to states of the original message, where

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-10 Thread Dmitry Kurochkin
Hi Austin. +/* The number of children of this part. */ +int children; Consider renaming to children_count or similar to make it clear that it is a counter and not the actual children. +notmuch_bool_t decrypt_success; Perhaps s/decrypt_success/is_decrypted/ for consistency with

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-09 Thread Austin Clements
This wraps all of the complex MIME part handling in a single, simple function that gets part N from *any* MIME object, so traversing a MIME part tree becomes a two-line for loop. Furthermore, the MIME node structure provides easy access to envelopes for message parts as well as cryptographic

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-09 Thread Austin Clements
This wraps all of the complex MIME part handling in a single, simple function that gets part N from *any* MIME object, so traversing a MIME part tree becomes a two-line for loop. Furthermore, the MIME node structure provides easy access to envelopes for message parts as well as cryptographic

Re: [PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-09 Thread Dmitry Kurochkin
Hi Austin. +/* The number of children of this part. */ +int children; Consider renaming to children_count or similar to make it clear that it is a counter and not the actual children. +notmuch_bool_t decrypt_success; Perhaps s/decrypt_success/is_decrypted/ for consistency with

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-04 Thread Austin Clements
This wraps all of the complex MIME part handling in a single, simple function that gets part N from *any* MIME object, so traversing a MIME part tree becomes a two-line for loop. Furthermore, the MIME node structure provides easy access to envelopes for message parts as well as cryptographic

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-04 Thread Austin Clements
Thanks for the review. A new version is on its way... Quoth Jani Nikula on Nov 29 at 9:11 pm: > > +mctx->stream = g_mime_stream_file_new (mctx->file); > > AFAICT the GMimeStreamFile object owns the FILE * pointer now, and > closes it later. Calling fclose() on it in

Re: [PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-04 Thread Austin Clements
Thanks for the review. A new version is on its way... Quoth Jani Nikula on Nov 29 at 9:11 pm: +mctx-stream = g_mime_stream_file_new (mctx-file); AFAICT the GMimeStreamFile object owns the FILE * pointer now, and closes it later. Calling fclose() on it in _mime_node_context_free()

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-12-04 Thread Austin Clements
This wraps all of the complex MIME part handling in a single, simple function that gets part N from *any* MIME object, so traversing a MIME part tree becomes a two-line for loop. Furthermore, the MIME node structure provides easy access to envelopes for message parts as well as cryptographic

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-11-29 Thread Jani Nikula
Hi, generally looks good to me, but please find a few comments below. BR, Jani. On Sun, 27 Nov 2011 21:21:09 -0500, Austin Clements wrote: > This wraps all of the complex MIME part handling in a single, simple > function that gets part N from *any* MIME object, so traversing a MIME > part tree

Re: [PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-11-29 Thread Jani Nikula
Hi, generally looks good to me, but please find a few comments below. BR, Jani. On Sun, 27 Nov 2011 21:21:09 -0500, Austin Clements amdra...@mit.edu wrote: This wraps all of the complex MIME part handling in a single, simple function that gets part N from *any* MIME object, so traversing a

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-11-27 Thread Austin Clements
This wraps all of the complex MIME part handling in a single, simple function that gets part N from *any* MIME object, so traversing a MIME part tree becomes a two-line for loop. Furthermore, the MIME node structure provides easy access to envelopes for message parts as well as cryptographic

[PATCH 2/4] Introduce a generic tree-like abstraction for MIME traversal.

2011-11-27 Thread Austin Clements
This wraps all of the complex MIME part handling in a single, simple function that gets part N from *any* MIME object, so traversing a MIME part tree becomes a two-line for loop. Furthermore, the MIME node structure provides easy access to envelopes for message parts as well as cryptographic