summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-06-02 21:10:39 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-06-02 21:10:39 +0200
commitcb71b9c56754abe739b889aeb9fd8bf80097c661 (patch)
treed9d1dad0620c819aeb2dca7d1586d12d87c2ab30 /main
parentb2319c8084d34edb85e0fee4ca7edcdee0c8aeed (diff)
Command to mark messages as seen
Changelog: Added `/seen` command to mark messages as seen.
Diffstat (limited to 'main')
-rw-r--r--main/Main.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/Main.hs b/main/Main.hs
index 8d7cc08..4b09d3d 100644
--- a/main/Main.hs
+++ b/main/Main.hs
@@ -385,7 +385,9 @@ interactiveLoop st opts = withTerminal commandCompletion $ \term -> do
Right prompt -> return prompt
lift $ setPrompt term $ plainText $ T.pack prompt
join $ lift $ getInputLine term $ \case
- Just input@('/' : _) -> KeepPrompt $ return input
+ Just input@('/' : _)
+ | "/seen" : _ <- words input -> ErasePrompt $ return input
+ | otherwise -> KeepPrompt $ return input
Just input -> ErasePrompt $ case reverse input of
_ | all isSpace input -> getInputLinesTui eprompt
'\\':rest -> (reverse ('\n':rest) ++) <$> getInputLinesTui (Right ">> ")
@@ -711,6 +713,7 @@ commands =
, ( "invite-accept", cmdInviteAccept )
, ( "conversations", cmdConversations )
, ( "new", cmdNew )
+ , ( "seen", cmdSeen )
, ( "details", cmdDetails )
, ( "discovery", cmdDiscovery )
, ( "join", cmdJoin )
@@ -1113,6 +1116,9 @@ cmdNew = do
= Just ( conv, msg )
checkNew _ = Nothing
+cmdSeen :: Command
+cmdSeen = markAllSeen =<< getSelectedConversation
+
cmdDetails :: Command
cmdDetails = do