summaryrefslogtreecommitdiffstats
path: root/src/Much/TreeView.hs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2020-09-30 11:45:41 +0200
committertv <tv@krebsco.de>2020-09-30 15:39:23 +0200
commit63bf1907d3e6629ac21da87b9e45303bcec2bdf9 (patch)
treeeebf73eec52795524f7cdcba6cc32272521565a0 /src/Much/TreeView.hs
parentf8b93d1f7150f6122ecf145936b9ac1abf413e2b (diff)
render non-text parts
Diffstat (limited to 'src/Much/TreeView.hs')
-rw-r--r--src/Much/TreeView.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Much/TreeView.hs b/src/Much/TreeView.hs
index 9487f74..e963497 100644
--- a/src/Much/TreeView.hs
+++ b/src/Much/TreeView.hs
@@ -18,6 +18,7 @@ module Much.TreeView
) where
+import qualified Data.ByteString.Lazy.Char8 as LBS8
import qualified Data.Text as T
import Data.Tree
import Notmuch
@@ -94,6 +95,8 @@ xconvPart m p =
contents = case partContent p of
ContentText t ->
zipWith (curry $ xconvLine m p) [0..] (T.lines t)
+ ContentRaw raw _ ->
+ zipWith (xconvRawLine m p) [0..] (lines . LBS8.unpack $ raw)
ContentMultipart parts ->
map (xconvPart m) parts
ContentMsgRFC822 _ ->
@@ -111,6 +114,12 @@ xconvLine m p (i, s) =
else TVMessageLine
+xconvRawLine
+ :: Message -> MessagePart -> LineNr -> String -> Tree TreeView
+xconvRawLine m p i s =
+ Node (TVMessageRawLine m p i s) []
+
+
isQuoteLine :: T.Text -> Bool
isQuoteLine s0 = do
let s = T.stripStart s0