summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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