summaryrefslogtreecommitdiffstats
path: root/Notmuch/Message.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Notmuch/Message.hs')
-rw-r--r--Notmuch/Message.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Notmuch/Message.hs b/Notmuch/Message.hs
index 29ca5ec..dd1e809 100644
--- a/Notmuch/Message.hs
+++ b/Notmuch/Message.hs
@@ -9,6 +9,7 @@ import Data.Time.Calendar
import Data.Time.Clock
import Data.Time.Clock.POSIX
import Data.Monoid
+import Notmuch.Class
import qualified Data.Text as T
import qualified Data.Map as M
import qualified Data.CaseInsensitive as CI
@@ -88,6 +89,9 @@ instance Eq Message where
a == b = messageId a == messageId b
+instance HasNotmuchId Message where
+ notmuchId = unMessageID . messageId
+
instance FromJSON Message where
parseJSON (Object v) = Message <$> (MessageID . ("id:"<>) <$> v .: "id")