summaryrefslogtreecommitdiffstats
path: root/Notmuch/SearchResult.hs
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-01-31 15:51:57 +0100
committertv <tv@shackspace.de>2015-01-31 15:51:57 +0100
commitef48d081dfd0e817c4959dbbd49929ae760a310e (patch)
tree54867be238b6f8707a43fa7af6d16d3f59144f73 /Notmuch/SearchResult.hs
parent39e76d0c83515a98f84f06b1c3b430d1e67cd1cd (diff)
Notmuch: replace {un,}setTag by notmuchTag
Diffstat (limited to 'Notmuch/SearchResult.hs')
-rw-r--r--Notmuch/SearchResult.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Notmuch/SearchResult.hs b/Notmuch/SearchResult.hs
index 3a75e96..52b8c20 100644
--- a/Notmuch/SearchResult.hs
+++ b/Notmuch/SearchResult.hs
@@ -7,6 +7,7 @@ import Data.Aeson
import Data.Text
import Data.Time.Clock
import Data.Time.Clock.POSIX
+import Notmuch.Class
newtype ThreadID = ThreadID { unThreadID :: String }
@@ -33,6 +34,10 @@ instance Eq SearchResult where
searchThread s1 == searchThread s2
+instance HasNotmuchId SearchResult where
+ notmuchId = unThreadID . searchThread
+
+
instance FromJSON SearchResult where
parseJSON (Object v) = SearchResult <$> ((ThreadID . ("thread:"++)) <$> v .: "thread")
<*> (posixSecondsToUTCTime . fromInteger <$> v .: "timestamp")