simplex-chat-6.5.0.7
Safe HaskellNone
LanguageHaskell2010

Simplex.Chat.Store.Messages

Synopsis

Documentation

getContactConnIds_ :: Connection -> User -> Contact -> IO [Int64] Source #

Message and chat item functions

deleteContactCIs :: Connection -> User -> Contact -> IO () Source #

getGroupFileInfo :: Connection -> User -> GroupInfo -> IO [CIFileInfo] Source #

deleteGroupChatItemsMessages :: Connection -> User -> GroupInfo -> IO () Source #

createNewSndMessage :: forall (e :: MsgEncoding). MsgEncodingI e => Connection -> TVar ChaChaDRG -> ConnOrGroupId -> ChatMsgEvent e -> (SharedMsgId -> EncodedChatMessage) -> ExceptT StoreError IO SndMessage Source #

createSndMsgDelivery :: Connection -> SndMsgDelivery -> MessageId -> IO Int64 Source #

getLastRcvMsgInfo :: Connection -> Int64 -> IO (Maybe RcvMsgInfo) Source #

createNewRcvMessage :: forall (e :: MsgEncoding). MsgEncodingI e => Connection -> ConnOrGroupId -> NewRcvMessage e -> Maybe SharedMsgId -> Maybe GroupMemberId -> Maybe GroupMemberId -> ExceptT StoreError IO RcvMessage Source #

updateSndMsgDeliveryStatus :: Connection -> Int64 -> AgentMsgId -> MsgDeliveryStatus 'MDSnd -> IO () Source #

createPendingGroupMessage :: Connection -> Int64 -> MessageId -> IO () Source #

getPendingGroupMessages :: Connection -> Int64 -> IO [SndMessage] Source #

deletePendingGroupMessage :: Connection -> Int64 -> MessageId -> IO () Source #

deleteOldMessages :: Connection -> UTCTime -> IO () Source #

data MemberAttention Source #

Constructors

MAInc Int (Maybe UTCTime) 
MAReset 

Instances

Instances details
Show MemberAttention Source # 
Instance details

Defined in Simplex.Chat.Store.Messages

Methods

showsPrec :: Int -> MemberAttention -> ShowS

show :: MemberAttention -> String

showList :: [MemberAttention] -> ShowS

updateChatTsStats :: forall (c :: ChatType) (d :: MsgDirection). Connection -> VersionRangeChat -> User -> ChatDirection c d -> UTCTime -> Maybe (Int, MemberAttention, Int) -> IO (ChatInfo c) Source #

setSupportChatTs :: Connection -> GroupMemberId -> UTCTime -> IO () Source #

createNewSndChatItem :: forall (c :: ChatType). Connection -> User -> ChatDirection c 'MDSnd -> SndMessage -> CIContent 'MDSnd -> Maybe (CIQuote c) -> Maybe CIForwardedFrom -> Maybe CITimed -> Bool -> UTCTime -> IO ChatItemId Source #

createNewRcvChatItem :: forall (c :: ChatType). ChatTypeQuotable c => Connection -> User -> ChatDirection c 'MDRcv -> RcvMessage -> Maybe SharedMsgId -> CIContent 'MDRcv -> Maybe CITimed -> Bool -> Bool -> UTCTime -> UTCTime -> IO (ChatItemId, Maybe (CIQuote c), Maybe CIForwardedFrom) Source #

createNewChatItemNoMsg :: forall (c :: ChatType) (d :: MsgDirection). MsgDirectionI d => Connection -> User -> ChatDirection c d -> ShowGroupAsSender -> CIContent d -> Maybe SharedMsgId -> UTCTime -> UTCTime -> IO ChatItemId Source #

createNewChatItem_ :: forall (c :: ChatType) (d :: MsgDirection). MsgDirectionI d => Connection -> User -> ChatDirection c d -> ShowGroupAsSender -> Maybe MessageId -> Maybe SharedMsgId -> CIContent d -> NewQuoteRow -> Maybe CIForwardedFrom -> Maybe CITimed -> Bool -> Bool -> UTCTime -> Maybe GroupMemberId -> UTCTime -> IO ChatItemId Source #

checkContactHasItems :: Connection -> User -> Contact -> IO Bool Source #

getDirectChat :: Connection -> VersionRangeChat -> User -> Int64 -> ChatPagination -> Maybe Text -> ExceptT StoreError IO (Chat 'CTDirect, Maybe NavigationInfo) Source #

getGroupChat :: Connection -> VersionRangeChat -> User -> Int64 -> Maybe GroupChatScope -> Maybe MsgContentTag -> ChatPagination -> Maybe Text -> ExceptT StoreError IO (Chat 'CTGroup, Maybe NavigationInfo) Source #

getLocalChat :: Connection -> User -> Int64 -> ChatPagination -> Maybe Text -> ExceptT StoreError IO (Chat 'CTLocal, Maybe NavigationInfo) Source #

getAllChatItems :: Connection -> VersionRangeChat -> User -> ChatPagination -> Maybe Text -> ExceptT StoreError IO [AChatItem] Source #

updateDirectChatItem :: forall (d :: MsgDirection). MsgDirectionI d => Connection -> User -> Contact -> ChatItemId -> CIContent d -> Bool -> Bool -> Maybe CITimed -> Maybe MessageId -> ExceptT StoreError IO (ChatItem 'CTDirect d) Source #

updateDirectChatItem' :: forall (d :: MsgDirection). MsgDirectionI d => Connection -> User -> Int64 -> ChatItem 'CTDirect d -> CIContent d -> Bool -> Bool -> Maybe CITimed -> Maybe MessageId -> IO (ChatItem 'CTDirect d) Source #

addInitialAndNewCIVersions :: Connection -> ChatItemId -> (UTCTime, MsgContent) -> (UTCTime, MsgContent) -> IO () Source #

createChatItemVersion :: Connection -> ChatItemId -> UTCTime -> MsgContent -> IO () Source #

deleteDirectChatItem :: forall (d :: MsgDirection). Connection -> User -> Contact -> ChatItem 'CTDirect d -> IO () Source #

markDirectChatItemDeleted :: forall (d :: MsgDirection). Connection -> User -> Contact -> ChatItem 'CTDirect d -> UTCTime -> IO (ChatItem 'CTDirect d) Source #

updateGroupChatItemStatus :: forall (d :: MsgDirection). MsgDirectionI d => Connection -> User -> GroupInfo -> ChatItemId -> CIStatus d -> ExceptT StoreError IO (ChatItem 'CTGroup d) Source #

updateGroupChatItem :: forall (d :: MsgDirection). MsgDirectionI d => Connection -> User -> Int64 -> ChatItem 'CTGroup d -> CIContent d -> Bool -> Bool -> Maybe MessageId -> IO (ChatItem 'CTGroup d) Source #

createGroupCIMentions :: forall (d :: MsgDirection). Connection -> GroupInfo -> ChatItem 'CTGroup d -> Map MemberName CIMention -> IO (ChatItem 'CTGroup d) Source #

updateGroupCIMentions :: forall (d :: MsgDirection). Connection -> GroupInfo -> ChatItem 'CTGroup d -> Map MemberName CIMention -> IO (ChatItem 'CTGroup d) Source #

deleteGroupChatItem :: forall (d :: MsgDirection). Connection -> User -> GroupInfo -> ChatItem 'CTGroup d -> IO () Source #

updateGroupChatItemModerated :: forall (d :: MsgDirection). MsgDirectionI d => Connection -> User -> GroupInfo -> ChatItem 'CTGroup d -> GroupMember -> UTCTime -> IO (ChatItem 'CTGroup d) Source #

updateMemberCIsModerated :: forall (d :: MsgDirection). MsgDirectionI d => Connection -> User -> GroupInfo -> GroupMember -> GroupMember -> SMsgDirection d -> UTCTime -> IO () Source #

updateGroupCIBlockedByAdmin :: forall (d :: MsgDirection). Connection -> User -> GroupInfo -> ChatItem 'CTGroup d -> UTCTime -> IO (ChatItem 'CTGroup d) Source #

markGroupChatItemDeleted :: forall (d :: MsgDirection). Connection -> User -> GroupInfo -> ChatItem 'CTGroup d -> Maybe GroupMember -> UTCTime -> IO (ChatItem 'CTGroup d) Source #

markMemberCIsDeleted :: Connection -> User -> GroupInfo -> GroupMember -> GroupMember -> UTCTime -> IO () Source #

markMessageReportsDeleted :: forall (d :: MsgDirection). Connection -> User -> GroupInfo -> ChatItem 'CTGroup d -> GroupMember -> UTCTime -> IO [ChatItemId] Source #

markReceivedGroupReportsDeleted :: Connection -> User -> GroupInfo -> UTCTime -> IO [ChatItemId] Source #

deleteLocalChatItem :: forall (d :: MsgDirection). Connection -> User -> NoteFolder -> ChatItem 'CTLocal d -> IO () Source #

updateDirectChatItemsRead :: Connection -> User -> ContactId -> IO () Source #

getDirectUnreadTimedItems :: Connection -> User -> ContactId -> IO [(ChatItemId, Int)] Source #

updateDirectChatItemsReadList :: Connection -> User -> ContactId -> NonEmpty ChatItemId -> IO [(ChatItemId, Int)] Source #

setDirectChatItemRead :: Connection -> User -> ContactId -> ChatItemId -> IO () Source #

setDirectChatItemsDeleteAt :: Connection -> User -> ContactId -> [(ChatItemId, Int)] -> UTCTime -> IO [(ChatItemId, UTCTime)] Source #

updateGroupChatItemsRead :: Connection -> User -> GroupInfo -> IO () Source #

getGroupUnreadTimedItems :: Connection -> User -> GroupId -> Maybe GroupChatScope -> IO [(ChatItemId, Int)] Source #

setGroupChatItemsDeleteAt :: Connection -> User -> GroupId -> [(ChatItemId, Int)] -> UTCTime -> IO [(ChatItemId, UTCTime)] Source #

updateLocalChatItemsRead :: Connection -> User -> NoteFolderId -> IO () Source #

getChatRefViaItemId :: Connection -> User -> ChatItemId -> ExceptT StoreError IO ChatRef Source #

getDirectReactions :: Connection -> Contact -> SharedMsgId -> Bool -> IO [MsgReaction] Source #

setDirectReaction :: Connection -> Contact -> SharedMsgId -> Bool -> MsgReaction -> Bool -> MessageId -> UTCTime -> IO () Source #

setGroupReaction :: Connection -> GroupInfo -> GroupMember -> MemberId -> SharedMsgId -> Bool -> MsgReaction -> Bool -> MessageId -> UTCTime -> IO () Source #

getChatItemIdsByAgentMsgId :: Connection -> Int64 -> AgentMsgId -> IO [ChatItemId] Source #

getDirectChatItem :: Connection -> User -> Int64 -> ChatItemId -> ExceptT StoreError IO (CChatItem 'CTDirect) Source #

getDirectChatItemsByAgentMsgId :: Connection -> User -> ContactId -> Int64 -> AgentMsgId -> IO [CChatItem 'CTDirect] Source #

getGroupChatItem :: Connection -> User -> Int64 -> ChatItemId -> ExceptT StoreError IO (CChatItem 'CTGroup) Source #

getGroupChatItemsByAgentMsgId :: Connection -> User -> GroupId -> Int64 -> AgentMsgId -> IO [CChatItem 'CTGroup] Source #

getLocalChatItem :: Connection -> User -> Int64 -> ChatItemId -> ExceptT StoreError IO (CChatItem 'CTLocal) Source #

updateLocalChatItem' :: forall (d :: MsgDirection). MsgDirectionI d => Connection -> User -> NoteFolderId -> ChatItem 'CTLocal d -> CIContent d -> Bool -> IO (ChatItem 'CTLocal d) Source #

getDirectChatItemIdByText :: forall (d :: MsgDirection). Connection -> UserId -> Int64 -> SMsgDirection d -> Text -> ExceptT StoreError IO ChatItemId Source #

getDirectChatItemIdByText' :: Connection -> User -> ContactId -> Text -> ExceptT StoreError IO ChatItemId Source #

getGroupChatItemIdByText :: Connection -> User -> GroupId -> Maybe ContactName -> Text -> ExceptT StoreError IO ChatItemId Source #

getGroupChatItemIdByText' :: Connection -> User -> GroupId -> Text -> ExceptT StoreError IO ChatItemId Source #

getLocalChatItemIdByText :: forall (d :: MsgDirection). Connection -> User -> NoteFolderId -> SMsgDirection d -> Text -> ExceptT StoreError IO ChatItemId Source #

getLocalChatItemIdByText' :: Connection -> User -> NoteFolderId -> Text -> ExceptT StoreError IO ChatItemId Source #

getChatItemByFileId :: Connection -> VersionRangeChat -> User -> Int64 -> ExceptT StoreError IO AChatItem Source #

lookupChatItemByFileId :: Connection -> VersionRangeChat -> User -> Int64 -> ExceptT StoreError IO (Maybe AChatItem) Source #

updateDirectChatItemStatus :: forall (d :: MsgDirection). MsgDirectionI d => Connection -> User -> Contact -> ChatItemId -> CIStatus d -> ExceptT StoreError IO (ChatItem 'CTDirect d) Source #

getTimedItems :: Connection -> User -> UTCTime -> IO [((ChatRef, ChatItemId), UTCTime)] Source #

getChatItemTTL :: Connection -> User -> IO Int64 Source #

setChatItemTTL :: Connection -> User -> Int64 -> IO () Source #

getChatTTLCount :: Connection -> User -> IO Int Source #

getContactExpiredFileInfo :: Connection -> User -> Contact -> UTCTime -> IO [CIFileInfo] Source #

deleteContactExpiredCIs :: Connection -> User -> Contact -> UTCTime -> IO () Source #

getGroupExpiredFileInfo :: Connection -> User -> GroupInfo -> UTCTime -> UTCTime -> IO [CIFileInfo] Source #

deleteGroupExpiredCIs :: Connection -> User -> GroupInfo -> UTCTime -> UTCTime -> IO () Source #

createCIModeration :: Connection -> GroupInfo -> GroupMember -> MemberId -> SharedMsgId -> MessageId -> UTCTime -> IO () Source #

getCIModeration :: Connection -> VersionRangeChat -> User -> GroupInfo -> MemberId -> Maybe SharedMsgId -> IO (Maybe CIModeration) Source #

deleteCIModeration :: Connection -> GroupInfo -> MemberId -> Maybe SharedMsgId -> IO () Source #

setGroupSndViaProxy :: Connection -> ChatItemId -> GroupMemberId -> Bool -> IO () Source #

getGroupSndStatusCounts :: Connection -> ChatItemId -> IO [(GroupSndStatus, Int)] Source #

getGroupHistoryItems :: Connection -> User -> GroupInfo -> GroupMember -> Int -> IO [Either StoreError (CChatItem 'CTGroup)] Source #