unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] cli/show: pass the siglist directly to the sigstatus sprinter
@ 2019-04-20 17:51 Daniel Kahn Gillmor
  2019-04-22 19:07 ` Tomi Ollila
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Kahn Gillmor @ 2019-04-20 17:51 UTC (permalink / raw)
  To: Notmuch Mail

This makes it easier to reuse format_part_sigstatus_sprinter() when we
have other places that we want to display a signature status.
---
 notmuch-show.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index 07e9a5db..88699e90 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -429,13 +429,11 @@ format_signature_errors (sprinter_t *sp, GMimeSignature *signature)
 
 /* Signature status sprinter (GMime 2.6) */
 static void
-format_part_sigstatus_sprinter (sprinter_t *sp, mime_node_t *node)
+format_part_sigstatus_sprinter (sprinter_t *sp, GMimeSignatureList *siglist)
 {
     /* Any changes to the JSON or S-Expression format should be
      * reflected in the file devel/schemata. */
 
-    GMimeSignatureList *siglist = node->sig_list;
-
     sp->begin_list (sp);
 
     if (!siglist) {
@@ -684,7 +682,7 @@ format_part_sprinter (const void *ctx, sprinter_t *sp, mime_node_t *node,
 
     if (node->verify_attempted) {
 	sp->map_key (sp, "sigstatus");
-	format_part_sigstatus_sprinter (sp, node);
+	format_part_sigstatus_sprinter (sp, node->sig_list);
     }
 
     sp->map_key (sp, "content-type");
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cli/show: pass the siglist directly to the sigstatus sprinter
  2019-04-20 17:51 [PATCH] cli/show: pass the siglist directly to the sigstatus sprinter Daniel Kahn Gillmor
@ 2019-04-22 19:07 ` Tomi Ollila
  0 siblings, 0 replies; 2+ messages in thread
From: Tomi Ollila @ 2019-04-22 19:07 UTC (permalink / raw)
  To: Daniel Kahn Gillmor, Notmuch Mail

On Sat, Apr 20 2019, Daniel Kahn Gillmor wrote:

> This makes it easier to reuse format_part_sigstatus_sprinter() when we
> have other places that we want to display a signature status.

Change looks trivial enough (and reduces the "scope" function sees which is
always good if it is enough -- I trust it is)

Tomi

> ---
>  notmuch-show.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/notmuch-show.c b/notmuch-show.c
> index 07e9a5db..88699e90 100644
> --- a/notmuch-show.c
> +++ b/notmuch-show.c
> @@ -429,13 +429,11 @@ format_signature_errors (sprinter_t *sp, GMimeSignature *signature)
>  
>  /* Signature status sprinter (GMime 2.6) */
>  static void
> -format_part_sigstatus_sprinter (sprinter_t *sp, mime_node_t *node)
> +format_part_sigstatus_sprinter (sprinter_t *sp, GMimeSignatureList *siglist)
>  {
>      /* Any changes to the JSON or S-Expression format should be
>       * reflected in the file devel/schemata. */
>  
> -    GMimeSignatureList *siglist = node->sig_list;
> -
>      sp->begin_list (sp);
>  
>      if (!siglist) {
> @@ -684,7 +682,7 @@ format_part_sprinter (const void *ctx, sprinter_t *sp, mime_node_t *node,
>  
>      if (node->verify_attempted) {
>  	sp->map_key (sp, "sigstatus");
> -	format_part_sigstatus_sprinter (sp, node);
> +	format_part_sigstatus_sprinter (sp, node->sig_list);
>      }
>  
>      sp->map_key (sp, "content-type");
> -- 
> 2.20.1
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-22 19:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-20 17:51 [PATCH] cli/show: pass the siglist directly to the sigstatus sprinter Daniel Kahn Gillmor
2019-04-22 19:07 ` Tomi Ollila

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).