diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-06-02 21:10:39 +0200 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-06-02 21:10:39 +0200 |
| commit | cb71b9c56754abe739b889aeb9fd8bf80097c661 (patch) | |
| tree | d9d1dad0620c819aeb2dca7d1586d12d87c2ab30 /main/Main.hs | |
| parent | b2319c8084d34edb85e0fee4ca7edcdee0c8aeed (diff) | |
Command to mark messages as seen
Changelog: Added `/seen` command to mark messages as seen.
Diffstat (limited to 'main/Main.hs')
| -rw-r--r-- | main/Main.hs | 8 |
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 |