summaryrefslogtreecommitdiff
path: root/src/Erebos/Conversation.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-07-29 21:06:38 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2025-07-29 21:06:38 +0200
commitf1652417c5d1006440b4c889ca052ec1713ac2eb (patch)
tree898f262f8363276cb0c138a39208d8a7a16e5508 /src/Erebos/Conversation.hs
parent21060feaebec1c0c49b33e474fbd9a076d8d8a1e (diff)
Rename DirectMessage functions to include dm/direct
Changelog: API: Renamed some functions in `DirectMessage` module to make clear they are related only to direct messages.
Diffstat (limited to 'src/Erebos/Conversation.hs')
-rw-r--r--src/Erebos/Conversation.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Erebos/Conversation.hs b/src/Erebos/Conversation.hs
index 1e3bad4..c882e23 100644
--- a/src/Erebos/Conversation.hs
+++ b/src/Erebos/Conversation.hs
@@ -81,7 +81,7 @@ isSameConversation _ _ = False
directMessageConversation :: MonadHead LocalState m => ComposedIdentity -> m Conversation
directMessageConversation peer = do
- (find (sameIdentity peer . msgPeer) . toThreadList . lookupSharedValue . lsShared . fromStored <$> getLocalHead) >>= \case
+ (find (sameIdentity peer . msgPeer) . dmThreadList . lookupSharedValue . lsShared . fromStored <$> getLocalHead) >>= \case
Just thread -> return $ DirectMessageConversation thread
Nothing -> return $ DirectMessageConversation $ DirectMessageThread peer [] [] [] []
@@ -96,8 +96,8 @@ reloadConversation (DirectMessageConversation thread) = directMessageConversatio
reloadConversation cur@(ChatroomConversation rstate) =
fromMaybe cur <$> chatroomConversation rstate
-lookupConversations :: MonadHead LocalState m => m [Conversation]
-lookupConversations = map DirectMessageConversation . toThreadList . lookupSharedValue . lsShared . fromStored <$> getLocalHead
+lookupConversations :: MonadHead LocalState m => m [ Conversation ]
+lookupConversations = map DirectMessageConversation . dmThreadList . lookupSharedValue . lsShared . fromStored <$> getLocalHead
conversationName :: Conversation -> Text
@@ -108,8 +108,8 @@ conversationPeer :: Conversation -> Maybe ComposedIdentity
conversationPeer (DirectMessageConversation thread) = Just $ msgPeer thread
conversationPeer (ChatroomConversation _) = Nothing
-conversationHistory :: Conversation -> [Message]
-conversationHistory (DirectMessageConversation thread) = map (\msg -> DirectMessageMessage msg False) $ threadToList thread
+conversationHistory :: Conversation -> [ Message ]
+conversationHistory (DirectMessageConversation thread) = map (\msg -> DirectMessageMessage msg False) $ dmThreadToList thread
conversationHistory (ChatroomConversation rstate) = map (\msg -> ChatroomMessage msg False) $ roomStateMessages rstate