From 8cc7c24db4b10bb31c8523a8ed0b6963b9b4fffa Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 23 May 2021 17:46:19 -0400 Subject: b4: Check for message ID match when using current buffer's URL 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. Message-Id: <20210523214623.31331-2-kyle@kyleam.com> --- 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 @@ This is intended to be used for debugging purposes.") ;; 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")) -- cgit v1.2.3