From 0e7bb74252714bf4886685e06e35407707754b78 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 19 Jul 2019 23:19:01 +0200 Subject: operations: Add get-bug-message-numbers. * debbugs/operations.scm (get-bug-message-numbers): New procedure. --- debbugs/operations.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/debbugs/operations.scm b/debbugs/operations.scm index ebf86b4..c3147ba 100644 --- a/debbugs/operations.scm +++ b/debbugs/operations.scm @@ -33,6 +33,7 @@ get-status get-bugs get-bug-log + get-bug-message-numbers get-usertag search-est @@ -134,6 +135,24 @@ Boolean value)." urn:Debbugs/SOAP:item)) response-body))) (map soap-email->email emails))))) +;; This is not an official operation. It's just really useful in +;; combination with fetch-mbox. +(define (get-bug-message-numbers bug-id) + "Return email message numbers associated with the bug identified by BUG-ID." + (soap-request + `(ns1:get_bug_log + (@ (xmlns:ns1 . "urn:Debbugs/SOAP") + (soapenc:encodingStyle . "http://schemas.xmlsoap.org/soap/encoding/")) + (ns1:bugnumber + (@ (xsi:type "xsd:int")) ,bug-id)) + (lambda (response-body) + (let ((msg-nums ((sxpath '(// urn:Debbugs/SOAP:get_bug_logResponse + http://schemas.xmlsoap.org/soap/encoding/:Array + urn:Debbugs/SOAP:item + urn:Debbugs/SOAP:msg_num + *text*)) response-body))) + (map string->number msg-nums))))) + (define (get-usertag email) "Return an association list of tag names to lists of bug numbers for all bugs that have been tagged by EMAIL." -- cgit v1.2.3