unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jon Hurst <jon@hursts.org.uk>
To: inwit <inwit@sindominio.net>
Subject: Re: Feature request: show destination in tree view when appropriate
Date: Tue, 19 Jul 2022 10:56:12 +0100	[thread overview]
Message-ID: <871quhxw77.fsf@hursts.org.uk> (raw)
In-Reply-To: <CLJIU9081RIS.3M4YBKDJ2UJ3O@bisio>

> (defun inwit/notmuch-search-authors-or-to (format-string result)
>   (let* ((headers (plist-get result :headers))
>          (to (plist-get headers :To))
>          (author (plist-get headers :From)))
>    (format format-string
>         (if (string-match "inwit" author)
>         (concat "To: " (notmuch-tree-clean-address to))
>                       author))))
> Any help would be greatly appreciated.

Your problem is that the result argument has this sort of form:

(:thread "00000000000029c5"
 :timestamp 1658007025
 :date_relative "Sat. 22:30"
 :matched 3
 :total 5
 :authors "David Bremner, Jon Hurst| inwit"
 :subject "Feature request: show destination in tree view when
 appropriate"
 :query ("id:87ilnx5mxq.fsf@tethera.net id:877d4dry2i.fsf@hursts.org.uk
         id:87cze468zy.fsf@tethera.net" "id:87a699e6wn.fsf@hursts.org.uk
         id:CLJIU9081RIS.3M4YBKDJ2UJ3O@bisio")
 :tags ("inbox" "replied")
 :orig-tags ("inbox" "replied"))

So there is no :headers and :authors has multiple entries. I guess what
you are looking for is that if the only author is yourself, replace the
author with the "To: ..." version, in which case you would have to use
the :query section to find that.

  reply	other threads:[~2022-07-19 11:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-16  9:36 Feature request: show destination in tree view when appropriate Jon Hurst
2022-07-16 11:14 ` David Bremner
2022-07-16 13:23   ` Jon Hurst
2022-07-16 21:30     ` David Bremner
2022-07-19  9:22     ` inwit
2022-07-19  9:56       ` Jon Hurst [this message]
2022-07-21 11:30     ` Jon Hurst

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

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871quhxw77.fsf@hursts.org.uk \
    --to=jon@hursts.org.uk \
    --cc=inwit@sindominio.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.
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).