(mapcar
(lambda (entry)
(if (and (eq 'list (car entry))
- (not (member "\\Noselect" (nth 1 (nth 1 entry)))))
+ (not (elmo-string-member-ignore-case "\\Noselect" (nth 1 (nth 1 entry)))))
(car (nth 1 entry))))
response)))
(app-data (car app-data))
(seen (member (car entity) (nth 4 app-data)))
mark)
- (if (member "\\Flagged" flags)
+ (if (elmo-string-member-ignore-case "\\Flagged" flags)
(elmo-msgdb-global-mark-set (car entity) (nth 3 app-data)))
(if (setq mark (elmo-msgdb-global-mark-get (car entity)))
- (unless (member "\\Seen" flags)
+ (unless (elmo-string-member-ignore-case "\\Seen" flags)
(setq elmo-imap4-seen-messages
(cons
(elmo-msgdb-overview-entity-get-number entity)
(elmo-file-cache-get (car entity)))
(if (or seen
(and use-flag
- (member "\\Seen" flags)))
+ (elmo-string-member-ignore-case "\\Seen" flags)))
nil
(nth 1 app-data))
(if (or seen
(and use-flag
- (member "\\Seen" flags)))
+ (elmo-string-member-ignore-case "\\Seen" flags)))
(if elmo-imap4-use-cache
(nth 2 app-data))
(nth 0 app-data))))))
(throw 'found t))
(setq slist (cdr slist)))))
+(cond ((fboundp 'member-ignore-case)
+ (defalias 'elmo-string-member-ignore-case 'member-ignore-case))
+ ((fboundp 'compare-strings)
+ (defun elmo-string-member-ignore-case (elt list)
+ "Like `member', but ignores differences in case and text representation.
+ELT must be a string. Upper-case and lower-case letters are treated as equal.
+Unibyte strings are converted to multibyte for comparison."
+ (while (and list (not (eq t (compare-strings elt 0 nil (car list) 0 nil t))))
+ (setq list (cdr list)))
+ list))
+ (t
+ (defun elmo-string-member-ignore-case (elt list)
+ "Like `member', but ignores differences in case and text representation.
+ELT must be a string. Upper-case and lower-case letters are treated as equal."
+ (let ((str (downcase elt)))
+ (while (and list (not (string= str (downcase (car list)))))
+ (setq list (cdr list)))
+ list))))
+
(defun elmo-string-match-member (str list &optional case-ignore)
(let ((case-fold-search case-ignore))
(catch 'member