discussion and development of piem
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: piem@inbox.kyleam.com
Subject: [PATCH 1/5] b4: Check for message ID match when using current buffer's URL
Date: Sun, 23 May 2021 17:46:19 -0400	[thread overview]
Message-ID: <20210523214623.31331-2-kyle@kyleam.com> (raw)
In-Reply-To: <20210523214623.31331-1-kyle@kyleam.com>

If piem-mid-to-thread-functions fails to generate the thread,
piem-b4--get-am-files tries to download the mbox from the URL
associated with the current buffer.  However, it uses the message ID
returned by piem-mid rather than the message ID passed by
piem-b4-am-from-mid.  That's not a safe assumption for non-interactive
calls to piem-b4-am-from-mid.

Construct the URL with the message ID passed by piem-b4-am-from-mid,
and skip the download completely if that message ID doesn't match the
one for the current buffer.
---
 piem-b4.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/piem-b4.el b/piem-b4.el
index f25a676..48c8bf4 100644
--- a/piem-b4.el
+++ b/piem-b4.el
@@ -72,8 +72,8 @@ (defun piem-b4--get-am-files (mid coderepo args)
     ;; try to download it from a URL at `piem-inboxes'.  Finally, fall
     ;; back to b4's configuration.
     (unless local-mbox-p
-      (when-let ((url (piem-inbox-get :url))
-                 (mid (piem-mid))
+      (when-let ((url (and (equal mid (piem-mid))
+                           (piem-inbox-get :url)))
                  (buffer (condition-case nil
                              (piem-download-and-decompress
                               (concat url (piem-escape-mid mid) "/t.mbox.gz"))
-- 
2.31.1


  reply	other threads:[~2021-05-23 21:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-23 21:46 [PATCH 0/5] Rework url-retrieve-synchronously wrapper Kyle Meyer
2021-05-23 21:46 ` Kyle Meyer [this message]
2021-05-23 21:46 ` [PATCH 2/5] " Kyle Meyer
2021-05-23 21:46 ` [PATCH 3/5] piem-gunzip-buffer: Check for gunzip executable Kyle Meyer
2021-05-23 21:46 ` [PATCH 4/5] piem-gunzip-buffer: Absorb caching of gunzip check Kyle Meyer
2021-05-23 21:46 ` [PATCH 5/5] piem-gunzip-buffer: Don't assume t.mbox.gz is being decompressed Kyle Meyer

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://git.kyleam.com/

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

  git send-email \
    --in-reply-to=20210523214623.31331-2-kyle@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=piem@inbox.kyleam.com \
    /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://git.kyleam.com/piem/

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).