Skip to content

Commit

Permalink
commiting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
owainlewis committed Aug 10, 2012
2 parents 61ee895 + 02875d1 commit e927eb3
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/clojure_mail/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@

(def settings (ref {:email "" :password ""}))

(def auth ((juxt :email :password) (deref settings)))
(defonce auth ((juxt :email :password) (deref settings)))

(defprotocol Imap
<<<<<<< HEAD
(connect [a b] "connect to IMAP server"))
=======
"Imap protocol"
(authorize [credentials])
(search [folder q]))
>>>>>>> 02875d1e52bdf210824e10eecfb55780cd671fc0

(def gmail {:protocol "imaps" :server "imap.gmail.com"})

(def last-uid (com.sun.mail.imap.IMAPFolder/LASTUID))
(defonce last-uid (com.sun.mail.imap.IMAPFolder/LASTUID))

;; TODO map of gmail folder defaults

Expand Down Expand Up @@ -118,6 +124,7 @@
(.getContentType msg))

;; There are a ton of these methods that need adding
;; Split into Mime namespace and do the same for other classes here when doing refactor

(defn get-msg-size
"Returns message size in bytes"
Expand All @@ -134,8 +141,12 @@
(let [fd (doto (.getFolder store folder) (.open Folder/READ_ONLY))]
(.getMessageCount fd)))

(defmacro with-folder [folder-name store]
`())
(def ^:dynamic current-folder)

(defmacro with-folder [folder store & body]
`(let [fd# (doto (.getFolder ~store ~folder) (.open Folder/READ_ONLY))]
(binding [current-folder fd#]
(do ~@body))))

(defn get-body-text
"Determine the function to call to get the body text of a message"
Expand Down

0 comments on commit e927eb3

Please sign in to comment.