aboutsummaryrefslogtreecommitdiff
path: root/piem-b4.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2021-05-23 17:46:19 -0400
committerKyle Meyer <kyle@kyleam.com>2021-05-23 17:47:53 -0400
commit8cc7c24db4b10bb31c8523a8ed0b6963b9b4fffa (patch)
tree2acfe8a95ab44dd885e802089f16d1cd60815e48 /piem-b4.el
parent29834774cfe18f7685840365e87c403fb770d617 (diff)
downloadpiem-8cc7c24db4b10bb31c8523a8ed0b6963b9b4fffa.tar.gz
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>
Diffstat (limited to 'piem-b4.el')
-rw-r--r--piem-b4.el4
1 files 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"))