diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-05-19 21:37:46 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-05-23 21:10:12 +0200 |
commit | 620e5840aba91d683bf7b4ee115079550aae8569 (patch) | |
tree | d813fa3b2be9085d45612fe381b0892d4cb119cc /src/Erebos/Message.hs | |
parent | 49db4661634b364ea49758666623a2efc3ac7107 (diff) |
Conversation interface
Changelog: Added `/conversations` command to list and select conversations
Diffstat (limited to 'src/Erebos/Message.hs')
-rw-r--r-- | src/Erebos/Message.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Erebos/Message.hs b/src/Erebos/Message.hs index ea86ca0..f8ad2cf 100644 --- a/src/Erebos/Message.hs +++ b/src/Erebos/Message.hs @@ -14,6 +14,7 @@ module Erebos.Message ( watchReceivedMessages, formatMessage, + formatDirectMessage, ) where import Control.Monad @@ -258,8 +259,12 @@ watchReceivedMessages h f = do forM_ (map fromStored sms) $ \ms -> do mapM_ f $ filter (not . sameIdentity self . msgFrom . fromStored) $ msReceived ms +{-# DEPRECATED formatMessage "use formatDirectMessage instead" #-} formatMessage :: TimeZone -> DirectMessage -> String -formatMessage tzone msg = concat +formatMessage = formatDirectMessage + +formatDirectMessage :: TimeZone -> DirectMessage -> String +formatDirectMessage tzone msg = concat [ formatTime defaultTimeLocale "[%H:%M] " $ utcToLocalTime tzone $ zonedTimeToUTC $ msgTime msg , maybe "<unnamed>" T.unpack $ idName $ msgFrom msg , ": " |