 
        (chat/register-message-transform!
          (fn [node]
-           (println node)
            (if (and (string? node) (upload/upload-path? node))
              (let [url node]
-               [:a.upload {:href url
-                             :title url
-                             :style {:background-color (color/url->color url)
-                                     :border-color (color/url->color url)}
-                             :on-click (fn [e] (.stopPropagation e))
-                             :target "_blank"
-                             ; rel to address vuln caused by target=_blank
-                             ; https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
-                             :rel "noopener noreferrer"
-                             :tab-index -1}
+               [:a.upload {:href (upload/->path url)
+                           :title url
+                           :style {:background-color (color/url->color url)
+                                   :border-color (color/url->color url)}
+                           :on-click (fn [e] (.stopPropagation e))
+                           :target "_blank"
+                           ; rel to address vuln caused by target=_blank
+                           ; https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
+                           :rel "noopener noreferrer"
+                           :tab-index -1}
                 (last (string/split url #"/"))])
              node)))
 

                                (some (fn [url]
                                        (re-matches #".*(png|jpg|jpeg|gif)$" url)))
                                first)]
              [image-embed-view url]))

          :styles
          [:>.image.upload

      {:href url
       :target "_blank"
       :rel "noopener noreferrer"}
      [:img {:src url}]]))

(defn ->s3config [config]
  {:api-secret (config :aws-secret-key)
