;;; -*-Scheme-*-
;;;
-;;; $Id: imail-core.scm,v 1.75 2000/05/19 20:03:12 cph Exp $
+;;; $Id: imail-core.scm,v 1.76 2000/05/19 21:02:00 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
(<imail-object>)
(header-fields define accessor)
(body define accessor)
- (flags define standard
- modifier %set-message-flags!)
+ (flags define accessor)
(folder define standard
initial-value #f)
(index define standard
(if (not (message? message))
(error:wrong-type-argument message "IMAIL message" procedure)))
+(define-generic set-message-flags! (message flags))
+
+(define-method set-message-flags! ((message <message>) flags)
+ (%set-message-flags! message flags))
+
+(define %set-message-flags!
+ (let ((modifier (slot-modifier <message> 'FLAGS)))
+ (lambda (message flags)
+ (modifier message flags)
+ (let ((folder (message-folder message)))
+ (if folder
+ (folder-modified! folder 'FLAGS message))))))
+
(define (message-attached? message #!optional folder)
(let ((folder (if (default-object? folder) #f folder)))
(if folder
(if (flags-member? flag flags)
(set-message-flags! message (flags-delete! flag flags)))))))
-(define (set-message-flags! message flags)
- (%set-message-flags! message flags)
- (let ((folder (message-folder message)))
- (if folder
- (folder-modified! folder 'FLAGS message))))
-
(define (folder-flags folder)
(let ((n (folder-length folder)))
(do ((index 0 (+ index 1))
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-imap.scm,v 1.60 2000/05/19 20:08:25 cph Exp $
+;;; $Id: imail-imap.scm,v 1.61 2000/05/19 21:02:20 cph Exp $
;;;
;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
;;;
;; Flags might have been updated while
;; reading the UIDs.
(if (%message-flags-initialized? m*)
- (%%set-message-flags! m (message-flags m*)))
+ (%set-message-flags! m (message-flags m*)))
(detach-message! m*)
(attach-message! m folder i*)
(vector-set! v* i* m)
(define (imap-message-connection message)
(imap-folder-connection (message-folder message)))
-(define-method %set-message-flags! ((message <imap-message>) flags)
+(define-method set-message-flags! ((message <imap-message>) flags)
(imap:command:uid-store-flags (imap-message-connection message)
(imap-message-uid message)
(map imail-flag->imap-flag
(define (process-fetch-attribute message keyword datum)
(case keyword
((FLAGS)
- (%%set-message-flags! message (map imap-flag->imail-flag datum))
+ (%set-message-flags! message (map imap-flag->imail-flag datum))
#t)
((RFC822.HEADER)
(%set-message-header-fields! message
(define %set-message-body!
(slot-modifier <imap-message> 'BODY))
-(define %%set-message-flags!
- (slot-modifier <imap-message> 'FLAGS))
-
(define %message-flags-initialized?
(slot-initpred <imap-message> 'FLAGS))