WIP: Remove download-message.
authorRicardo Wurmus <rekado@elephly.net>
Tue, 7 Apr 2020 12:21:00 +0000 (14:21 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Tue, 7 Apr 2020 12:21:00 +0000 (14:21 +0200)
mumi/messages.scm

index e97e80dc33107f3e5321f0ebb76b244e4d1f114a..108275b8f326dc0e8d160fb54e9f2d10f030607b 100644 (file)
@@ -40,7 +40,6 @@
             wishlist-bugs
             bugs-by-severity
 
-            download-message
 
             multipart-message?
             extract-attachment))
@@ -151,31 +150,6 @@ we have to do this in a very convoluted way."
                (_ #f)))))))
 
 \f
-(define (download-message bug-id msg-num)
-  "Download message number MSG-NUM of bug BUG-ID and store it in the
-mail directory if it's not already there.  Return the name of the
-target file."
-  (let ((key (list 'download-message bug-id msg-num)))
-    (or (cached? key)
-        (cache! key
-                (let ((file-name (format #f "~a/cur/~a-~a"
-                                         (%config 'mail-dir)
-                                         bug-id msg-num)))
-                  (if (file-exists? file-name) file-name
-                      (begin
-                        (format (current-error-port)
-                                "downloading ~a~%" file-name)
-                        (call-with-values
-                            (lambda ()
-                              (fetch-mbox (%config 'debbugs)
-                                          bug-id msg-num #:streaming? #t))
-                          (lambda (response port)
-                            (with-output-to-file file-name
-                              (lambda ()
-                                (put-bytevector (current-output-port)
-                                                (get-bytevector-all port))))
-                            (close-port port)))
-                        file-name)))))))
 
 ;; We would like to use get-bug-log here, but it often returns
 ;; truncated messages.  This is a known bug upstream.