Use APPEND-MAP, not MAP, over the list of internal header fields in
authorTaylor R. Campbell <net/mumble/campbell>
Mon, 11 Aug 2008 22:27:26 +0000 (22:27 +0000)
committerTaylor R. Campbell <net/mumble/campbell>
Mon, 11 Aug 2008 22:27:26 +0000 (22:27 +0000)
HEADER-FIELDS->MESSAGE-FLAGS: BURST-STRING returns a list of flags
each time, the collection of which we want to concatenate before
deleting duplicates.

v7/src/imail/imail-core.scm

index bb679ad09b9b0351c659c9992e83d45898edd08a..5365e30c3088b2b91ea6c67df13106cb44a60f50 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: imail-core.scm,v 1.171 2008/07/03 20:08:07 cph Exp $
+$Id: imail-core.scm,v 1.172 2008/08/11 22:27:26 riastradh Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -944,13 +944,14 @@ USA.
                              (decorated-string-append "" " " "" flags)))
 
 (define (header-fields->message-flags headers)
-  (delete-duplicates! (map (lambda (header)
-                            (burst-string (header-field-value header)
-                                          char-set:whitespace
-                                          #t))
-                          (filter (internal-header-field-predicate "FLAGS")
-                                  headers))
-                     string-ci=?))
+  (delete-duplicates
+   (append-map (lambda (header)
+                 (burst-string (header-field-value header)
+                               char-set:whitespace
+                               #t))
+               (filter (internal-header-field-predicate "FLAGS")
+                       headers))
+   string-ci=?))
 \f
 (define (message-deleted? msg) (message-flagged? msg "deleted"))
 (define (message-undeleted? msg) (not (message-flagged? msg "deleted")))