Changeset 3956

Show
Ignore:
Timestamp:
09/24/08 15:45:25 (2 months ago)
Author:
hans
Message:

Do not display :nudes or :explicit images on home page

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/quickhoney/src/handlers.lisp

    r3919 r3956  
    6262    (encode-object-element "client" (or (quickhoney-image-client image) "")) 
    6363    (when (typep image 'quickhoney-animation-image) 
    64       (encode-object-element "animation_type" (image-content-type (blob-mime-type (quickhoney-animation-image-animation image))))) 
     64      (encode-object-element "animation_type" 
     65                             (image-content-type (blob-mime-type (quickhoney-animation-image-animation image))))) 
    6566    (when (quickhoney-image-spider-keywords image) 
    6667      (encode-object-element "spider_keywords" (quickhoney-image-spider-keywords image))) 
     
    174175 
    175176(defmethod handle-object ((handler digg-image-handler) (image quickhoney-image)) 
    176   (with-query-params (from text) 
     177  (with-query-params (from to text) 
    177178    (cl-smtp:with-smtp-mail (smtp "localhost" 
    178179                                  "webserver@quickhoney.com" 
    179                                   (if (owned-object-owner image) 
    180                                       (list (user-email (owned-object-owner image))) 
    181                                       (mapcar (alexandria:compose #'user-email #'find-user) (list "n" "p")))) 
     180                                  (cond 
     181                                    ((and to (length to)) 
     182                                     (list to)) 
     183                                    ((owned-object-owner image) 
     184                                     (list (user-email (owned-object-owner image)))) 
     185                                    (t 
     186                                     (mapcar (alexandria:compose #'user-email #'find-user) (list "n" "p"))))) 
    182187      (cl-mime:print-mime 
    183188       smtp 
     
    234239(defun newest-images (category subcategory) 
    235240  (let ((images (if (eq :home category) 
    236                     (images-in-all-subcategories-sorted-by-time subcategory) 
     241                    (remove-if (lambda (image) 
     242                                 (or (eq :nudes (quickhoney-image-subcategory image)) 
     243                                     (find :explicit (store-image-keywords image)))) 
     244                               (images-in-all-subcategories-sorted-by-time subcategory)) 
    237245                    (images-in-category-sorted-by-time (list category subcategory))))) 
    238246    (when images