summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-01-31 14:49:25 +0100
committertv <tv@shackspace.de>2015-01-31 15:13:00 +0100
commit39e76d0c83515a98f84f06b1c3b430d1e67cd1cd (patch)
tree928ddf6f729fe18c9e78858c340056c86dd855eb
parentc2c06d1d436df298cc60e3af37684de056eb2fc9 (diff)
Notmuch: "id:" and "thread:" are part of ID
-rw-r--r--Notmuch.hs4
-rw-r--r--Notmuch/Message.hs2
-rw-r--r--Notmuch/SearchResult.hs2
-rw-r--r--TreeView.hs4
-rw-r--r--test5.hs8
5 files changed, 10 insertions, 10 deletions
diff --git a/Notmuch.hs b/Notmuch.hs
index 8b45741..c39c4c0 100644
--- a/Notmuch.hs
+++ b/Notmuch.hs
@@ -179,9 +179,9 @@ notmuchShowPart term partId = do
setTag :: String -> String -> IO LBS.ByteString
setTag tag i = do
- notmuch [ "tag", "+" <> tag , "id:" <> i ]
+ notmuch [ "tag", "+" <> tag , i ]
unsetTag :: String -> String -> IO LBS.ByteString
unsetTag tag i = do
- notmuch [ "tag", "-" <> tag , "id:" <> i ]
+ notmuch [ "tag", "-" <> tag , i ]
diff --git a/Notmuch/Message.hs b/Notmuch/Message.hs
index d458c5f..29ca5ec 100644
--- a/Notmuch/Message.hs
+++ b/Notmuch/Message.hs
@@ -90,7 +90,7 @@ instance Eq Message where
instance FromJSON Message where
- parseJSON (Object v) = Message <$> v .: "id"
+ parseJSON (Object v) = Message <$> (MessageID . ("id:"<>) <$> v .: "id")
<*> (posixSecondsToUTCTime . fromInteger <$> v .: "timestamp")
<*> (M.mapKeys CI.mk <$> v .: "headers")
<*> v .: "body"
diff --git a/Notmuch/SearchResult.hs b/Notmuch/SearchResult.hs
index 6d3f9be..3a75e96 100644
--- a/Notmuch/SearchResult.hs
+++ b/Notmuch/SearchResult.hs
@@ -34,7 +34,7 @@ instance Eq SearchResult where
instance FromJSON SearchResult where
- parseJSON (Object v) = SearchResult <$> v .: "thread"
+ parseJSON (Object v) = SearchResult <$> ((ThreadID . ("thread:"++)) <$> v .: "thread")
<*> (posixSecondsToUTCTime . fromInteger <$> v .: "timestamp")
<*> v .: "date_relative"
<*> v .:? "subject" .!= ""
diff --git a/TreeView.hs b/TreeView.hs
index 92264e7..470913b 100644
--- a/TreeView.hs
+++ b/TreeView.hs
@@ -221,8 +221,8 @@ loadSubForest = \case
return $ Right []
where
- termFromMessage = ("id:" <>) . unMessageID . messageId
- termFromSearchResult = ("thread:" <>) . unThreadID . searchThread
+ termFromMessage = unMessageID . messageId
+ termFromSearchResult = unThreadID . searchThread
unloadSubForest :: Tree TreeView -> Forest TreeView
diff --git a/test5.hs b/test5.hs
index 0c3dbf2..b9ca124 100644
--- a/test5.hs
+++ b/test5.hs
@@ -448,7 +448,7 @@ replyToAll q@State{..} = case getMessage (Z.label cursor) of
(_, _, _, procH) <-
withFile "/dev/null" ReadMode $ \nullH ->
createProcess
- (proc "notmuch" [ "reply" , "id:" ++ msgId ])
+ (proc "notmuch" [ "reply" , msgId ])
{ std_in = UseHandle nullH
, std_out = UseHandle draftH
}
@@ -496,7 +496,7 @@ viewSource q@State{..} = case getMessage (Z.label cursor) of
(_, _, _, procH) <-
withFile "/dev/null" ReadMode $ \nullH ->
createProcess
- (proc "notmuch" [ "show", "--format=raw", "id:" ++ msgId ])
+ (proc "notmuch" [ "show", "--format=raw", msgId ])
{ std_in = UseHandle nullH
, std_out = UseHandle draftH
}
@@ -516,7 +516,7 @@ editTags q@State{..} = case Z.label cursor of
TVSearchResult sr -> do
edit
(Notmuch.searchTags sr)
- ("thread:" <> (Notmuch.unThreadID $ Notmuch.searchThread sr))
+ (Notmuch.unThreadID $ Notmuch.searchThread sr)
(\tagOps loc ->
Z.modifyTree (patchTreeTags tagOps) loc
)
@@ -524,7 +524,7 @@ editTags q@State{..} = case Z.label cursor of
TVMessage m -> do
edit
(Notmuch.messageTags m)
- ("id:" <> (Notmuch.unMessageID $ Notmuch.messageId m)) -- TODO describe war besser
+ (Notmuch.unMessageID $ Notmuch.messageId m) -- TODO describe war besser
(\tagOps mloc ->
-- TODO this needs test cases
let