- (and (member issuer gnus-nocem-issuers) ; We like her....
- (gnus-nocem-verify-issuer issuer) ; She is who she says she is...
- (gnus-nocem-enter-article) ; We gobble the message..
- (push (mail-header-message-id header) ; But don't come back for
- gnus-nocem-seen-message-ids)))))) ; second helpings.
+ (if (not (gnus-nocem-message-wanted-p issuer type))
+ (message "invalid NoCeM issuer: %s" issuer)
+ (and (gnus-nocem-verify-issuer issuer) ; She is who she says she is.
+ (gnus-nocem-enter-article) ; We gobble the message.
+ (push (mail-header-message-id header) ; But don't come back for
+ gnus-nocem-seen-message-ids))))))) ; second helpings.
+
+(defun gnus-nocem-message-wanted-p (issuer type)
+ (let ((issuers gnus-nocem-issuers)
+ wanted conditions condition)
+ (cond
+ ;; Do the quick check first.
+ ((member issuer issuers)
+ t)
+ ((setq conditions (cdr (assoc issuer issuers)))
+ ;; Check whether we want this type.
+ (while (setq condition (pop conditions))
+ (cond
+ ((stringp condition)
+ (setq wanted (string-match condition type)))
+ ((and (consp condition)
+ (eq (car condition) 'not)
+ (stringp (cadr condition)))
+ (setq wanted (not (string-match (cadr condition) type))))
+ (t
+ (error "Invalid NoCeM condition: %S" condition))))
+ wanted))))