]> git.notmuchmail.org Git - notmuch/commitdiff
mime-node: be clearer about decryption
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 31 May 2019 01:18:53 +0000 (21:18 -0400)
committerDavid Bremner <david@tethera.net>
Fri, 31 May 2019 10:55:46 +0000 (07:55 -0300)
Part 0 of a multipart/encrypted object is
GMIME_MULTIPART_ENCRYPTED_VERSION; part 1 is
GMIME_MULTIPART_ENCRYPTED_CONTENT.  Using the name for what we want
describes our intent more clearly than using a magic number in the
code.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
mime-node.c

index 3492bcd039463bca7f0c6421b32437210f7d5471..a93cbb31daed9d54f0ef8fdfe97414952ebba85c 100644 (file)
@@ -339,7 +339,7 @@ mime_node_child (mime_node_t *parent, int child)
        return NULL;
 
     if (GMIME_IS_MULTIPART (parent->part)) {
-       if (child == 1 && parent->decrypted_child)
+       if (child == GMIME_MULTIPART_ENCRYPTED_CONTENT && parent->decrypted_child)
            sub = parent->decrypted_child;
        else
            sub = g_mime_multipart_get_part