Skip to content
Browse files

Updated "read" to be "read-message" to prevent namespace clashes with…

… clojure-core.
  • Loading branch information...
1 parent 2049cfa commit 931d788b02ad4f075682999ba47c13d6290a1b4d @ncantor ncantor committed Dec 13, 2012
Showing with 5 additions and 8 deletions.
  1. +2 −2 README.md
  2. +1 −1 project.clj
  3. +1 −3 src/clojure_mail/core.clj
  4. +1 −2 src/clojure_mail/message.clj
View
4 README.md
@@ -29,11 +29,11 @@ In this example we'll log into a Gmail account and read messages from the inbox
;; And read the first message in our inbox
-(msg/read (first (get-inbox)))
+(msg/read-message (first (get-inbox)))
;; Get 5 messages from the spam folder
-(map #(msg/read %)
+(map #(msg/read-message %)
(take 5 (get-spam)))
```
View
2 project.clj
@@ -1,4 +1,4 @@
-(defproject org.clojars.ncantor/clojure-mail "0.1.3-SNAPSHOT"
+(defproject org.clojars.ncantor/clojure-mail "0.1.5-SNAPSHOT"
:description "Clojure Email Library"
:url "https://github.com/forward/clojure-mail"
:license {:name "Eclipse Public License"
View
4 src/clojure_mail/core.clj
@@ -1,5 +1,4 @@
(ns clojure-mail.core
- (refer-clojure :exclude [read])
(:require [clojure-mail.store :as store]
[clojure-mail.message :as msg]
[clojure-mail.folder :as folder])
@@ -91,7 +90,7 @@
(defn read-message
"Reads a java mail message instance"
[message]
- (msg/read message))
+ (msg/read-message message))
(defn search [query])
@@ -113,7 +112,6 @@
[fd]
(let [fd (doto (.getFolder (gen-store) fd) (.open Folder/READ_WRITE))
messages (.search fd (FlagTerm. (Flags. Flags$Flag/SEEN) false))]
- (prn (apply str messages))
(doall (map #(.getContent %) messages))
nil))
View
3 src/clojure_mail/message.clj
@@ -1,5 +1,4 @@
(ns clojure-mail.message
- (refer-clojure :exclude [read])
(import [javax.mail.internet MimeMessage MimeMultipart InternetAddress]))
;; Utilities for parsing email messages
@@ -110,7 +109,7 @@
;; Public API for working with messages
-(defn read [msg]
+(defn read-message [msg]
"Returns a workable map of the message content.
This is the ultimate goal in extracting a message
as a clojure map"

0 comments on commit 931d788

Please sign in to comment.
Something went wrong with that request. Please try again.