summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2019-07-19 23:19:01 +0200
committerRicardo Wurmus <rekado@elephly.net>2019-07-19 23:19:01 +0200
commit0e7bb74252714bf4886685e06e35407707754b78 (patch)
tree89b12bf889ed4f3eb14eb725a8cbbf8b8e36f8d1
parent0412808399454e3c07d0d44361c7cc5962fe2b3a (diff)
operations: Add get-bug-message-numbers.
* debbugs/operations.scm (get-bug-message-numbers): New procedure.
-rw-r--r--debbugs/operations.scm19
1 files changed, 19 insertions, 0 deletions
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."