| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Simplex.Chat.Messages.CIContent
Synopsis
- data MsgDirection
- data SMsgDirection (d :: MsgDirection) where
- SMDRcv :: SMsgDirection 'MDRcv
- SMDSnd :: SMsgDirection 'MDSnd
- data AMsgDirection = MsgDirectionI d => AMsgDirection (SMsgDirection d)
- toMsgDirection :: forall (d :: MsgDirection). SMsgDirection d -> MsgDirection
- fromMsgDirection :: MsgDirection -> AMsgDirection
- class MsgDirectionI (d :: MsgDirection) where
- checkDirection :: forall t (d :: MsgDirection) (d' :: MsgDirection). (MsgDirectionI d, MsgDirectionI d') => t d' -> Either String (t d)
- msgDirectionInt :: MsgDirection -> Int
- msgDirectionIntP :: Int64 -> Maybe MsgDirection
- data CIDeleteMode
- ciDeleteModeToText :: CIDeleteMode -> Text
- data CIContent (d :: MsgDirection) where
- CISndMsgContent :: MsgContent -> CIContent 'MDSnd
- CIRcvMsgContent :: MsgContent -> CIContent 'MDRcv
- CISndDeleted :: CIDeleteMode -> CIContent 'MDSnd
- CIRcvDeleted :: CIDeleteMode -> CIContent 'MDRcv
- CISndCall :: CICallStatus -> Int -> CIContent 'MDSnd
- CIRcvCall :: CICallStatus -> Int -> CIContent 'MDRcv
- CIRcvIntegrityError :: MsgErrorType -> CIContent 'MDRcv
- CIRcvDecryptionError :: MsgDecryptError -> Word32 -> CIContent 'MDRcv
- CIRcvGroupInvitation :: CIGroupInvitation -> GroupMemberRole -> CIContent 'MDRcv
- CISndGroupInvitation :: CIGroupInvitation -> GroupMemberRole -> CIContent 'MDSnd
- CIRcvDirectEvent :: RcvDirectEvent -> CIContent 'MDRcv
- CIRcvGroupEvent :: RcvGroupEvent -> CIContent 'MDRcv
- CISndGroupEvent :: SndGroupEvent -> CIContent 'MDSnd
- CIRcvConnEvent :: RcvConnEvent -> CIContent 'MDRcv
- CISndConnEvent :: SndConnEvent -> CIContent 'MDSnd
- CIRcvChatFeature :: ChatFeature -> PrefEnabled -> Maybe Int -> CIContent 'MDRcv
- CISndChatFeature :: ChatFeature -> PrefEnabled -> Maybe Int -> CIContent 'MDSnd
- CIRcvChatPreference :: ChatFeature -> FeatureAllowed -> Maybe Int -> CIContent 'MDRcv
- CISndChatPreference :: ChatFeature -> FeatureAllowed -> Maybe Int -> CIContent 'MDSnd
- CIRcvGroupFeature :: GroupFeature -> GroupPreference -> Maybe Int -> Maybe GroupMemberRole -> CIContent 'MDRcv
- CISndGroupFeature :: GroupFeature -> GroupPreference -> Maybe Int -> Maybe GroupMemberRole -> CIContent 'MDSnd
- CIRcvChatFeatureRejected :: ChatFeature -> CIContent 'MDRcv
- CIRcvGroupFeatureRejected :: GroupFeature -> CIContent 'MDRcv
- CISndModerated :: CIContent 'MDSnd
- CIRcvModerated :: CIContent 'MDRcv
- CIRcvBlocked :: CIContent 'MDRcv
- CISndDirectE2EEInfo :: E2EInfo -> CIContent 'MDSnd
- CIRcvDirectE2EEInfo :: E2EInfo -> CIContent 'MDRcv
- CISndGroupE2EEInfo :: E2EInfo -> CIContent 'MDSnd
- CIRcvGroupE2EEInfo :: E2EInfo -> CIContent 'MDRcv
- CIChatBanner :: CIContent 'MDSnd
- CIInvalidJSON :: forall (d :: MsgDirection). Text -> CIContent d
- data E2EInfo = E2EInfo {
- pqEnabled :: Maybe PQEncryption
- ciMsgContent :: forall (d :: MsgDirection). CIContent d -> Maybe MsgContent
- isCIReport :: forall (d :: MsgDirection). CIContent d -> Bool
- data MsgDecryptError
- ciRequiresAttention :: forall (d :: MsgDirection). MsgDirectionI d => CIContent d -> Bool
- newtype DBMsgErrorType = DBME MsgErrorType
- data CIGroupInvitation = CIGroupInvitation {}
- data CIGroupInvitationStatus
- ciContentToText :: forall (d :: MsgDirection). CIContent d -> Text
- directE2EInfoToText :: E2EInfo -> Text
- groupE2EInfoToText :: E2EInfo -> Text
- simpleE2EText :: Text
- e2eInfoNoPQText :: Text
- e2eInfoPQText :: Text
- ciGroupInvitationToText :: CIGroupInvitation -> GroupMemberRole -> Text
- rcvDirectEventToText :: RcvDirectEvent -> Text
- rcvGroupEventToText :: RcvGroupEvent -> Text
- sndGroupEventToText :: SndGroupEvent -> Text
- pendingReviewMessage :: Text
- acceptedToGroupMessage :: Text
- rcvConnEventToText :: RcvConnEvent -> Text
- ratchetSyncStatusToText :: RatchetSyncState -> Text
- sndConnEventToText :: SndConnEvent -> Text
- profileToText :: Profile -> Text
- msgIntegrityError :: MsgErrorType -> Text
- msgDecryptErrorText :: MsgDecryptError -> Word32 -> Text
- msgDirToModeratedContent_ :: forall (d :: MsgDirection). SMsgDirection d -> CIContent d
- ciModeratedText :: Text
- data ACIContent = MsgDirectionI d => ACIContent (SMsgDirection d) (CIContent d)
- data JSONCIContent
- = JCISndMsgContent { }
- | JCIRcvMsgContent { }
- | JCISndDeleted { }
- | JCIRcvDeleted { }
- | JCISndCall {
- status :: CICallStatus
- duration :: Int
- | JCIRcvCall {
- status :: CICallStatus
- duration :: Int
- | JCIRcvIntegrityError {
- msgError :: MsgErrorType
- | JCIRcvDecryptionError {
- msgDecryptError :: MsgDecryptError
- msgCount :: Word32
- | JCIRcvGroupInvitation { }
- | JCISndGroupInvitation { }
- | JCIRcvDirectEvent { }
- | JCIRcvGroupEvent { }
- | JCISndGroupEvent { }
- | JCIRcvConnEvent { }
- | JCISndConnEvent { }
- | JCIRcvChatFeature {
- feature :: ChatFeature
- enabled :: PrefEnabled
- param :: Maybe Int
- | JCISndChatFeature {
- feature :: ChatFeature
- enabled :: PrefEnabled
- param :: Maybe Int
- | JCIRcvChatPreference {
- feature :: ChatFeature
- allowed :: FeatureAllowed
- param :: Maybe Int
- | JCISndChatPreference {
- feature :: ChatFeature
- allowed :: FeatureAllowed
- param :: Maybe Int
- | JCIRcvGroupFeature {
- groupFeature :: GroupFeature
- preference :: GroupPreference
- param :: Maybe Int
- memberRole_ :: Maybe GroupMemberRole
- | JCISndGroupFeature {
- groupFeature :: GroupFeature
- preference :: GroupPreference
- param :: Maybe Int
- memberRole_ :: Maybe GroupMemberRole
- | JCIRcvChatFeatureRejected { }
- | JCIRcvGroupFeatureRejected { }
- | JCISndModerated
- | JCIRcvModerated
- | JCIRcvBlocked
- | JCISndDirectE2EEInfo { }
- | JCIRcvDirectE2EEInfo { }
- | JCISndGroupE2EEInfo { }
- | JCIRcvGroupE2EEInfo { }
- | JCIChatBanner
- | JCIInvalidJSON {
- direction :: MsgDirection
- json :: Text
- jsonCIContent :: forall (d :: MsgDirection). MsgDirectionI d => CIContent d -> JSONCIContent
- aciContentJSON :: JSONCIContent -> ACIContent
- data DBJSONCIContent
- = DBJCISndMsgContent { }
- | DBJCIRcvMsgContent { }
- | DBJCISndDeleted { }
- | DBJCIRcvDeleted { }
- | DBJCISndCall {
- status :: CICallStatus
- duration :: Int
- | DBJCIRcvCall {
- status :: CICallStatus
- duration :: Int
- | DBJCIRcvIntegrityError { }
- | DBJCIRcvDecryptionError {
- msgDecryptError :: MsgDecryptError
- msgCount :: Word32
- | DBJCIRcvGroupInvitation { }
- | DBJCISndGroupInvitation { }
- | DBJCIRcvDirectEvent { }
- | DBJCIRcvGroupEvent { }
- | DBJCISndGroupEvent { }
- | DBJCIRcvConnEvent { }
- | DBJCISndConnEvent { }
- | DBJCIRcvChatFeature {
- feature :: ChatFeature
- enabled :: PrefEnabled
- param :: Maybe Int
- | DBJCISndChatFeature {
- feature :: ChatFeature
- enabled :: PrefEnabled
- param :: Maybe Int
- | DBJCIRcvChatPreference {
- feature :: ChatFeature
- allowed :: FeatureAllowed
- param :: Maybe Int
- | DBJCISndChatPreference {
- feature :: ChatFeature
- allowed :: FeatureAllowed
- param :: Maybe Int
- | DBJCIRcvGroupFeature {
- groupFeature :: GroupFeature
- preference :: GroupPreference
- param :: Maybe Int
- memberRole_ :: Maybe GroupMemberRole
- | DBJCISndGroupFeature {
- groupFeature :: GroupFeature
- preference :: GroupPreference
- param :: Maybe Int
- memberRole_ :: Maybe GroupMemberRole
- | DBJCIRcvChatFeatureRejected { }
- | DBJCIRcvGroupFeatureRejected { }
- | DBJCISndModerated
- | DBJCIRcvModerated
- | DBJCIRcvBlocked
- | DBJCISndDirectE2EEInfo { }
- | DBJCIRcvDirectE2EEInfo { }
- | DBJCISndGroupE2EEInfo { }
- | DBJCIRcvGroupE2EEInfo { }
- | DBJCIChatBanner
- | DBJCIInvalidJSON {
- direction :: MsgDirection
- json :: Text
- dbJsonCIContent :: forall (d :: MsgDirection). MsgDirectionI d => CIContent d -> DBJSONCIContent
- aciContentDBJSON :: DBJSONCIContent -> ACIContent
- data CICallStatus
- ciCallInfoText :: CICallStatus -> Int -> Text
- callComplete :: CICallStatus -> Bool
- dbParseACIContent :: Text -> Either String ACIContent
- sndMsgContentTag :: Text
- rcvMsgContentTag :: Text
- toCIContentTag :: forall (e :: MsgDirection). CIContent e -> Text
Documentation
data MsgDirection Source #
Instances
data SMsgDirection (d :: MsgDirection) where Source #
Constructors
| SMDRcv :: SMsgDirection 'MDRcv | |
| SMDSnd :: SMsgDirection 'MDSnd |
Instances
data AMsgDirection Source #
Constructors
| MsgDirectionI d => AMsgDirection (SMsgDirection d) |
Instances
| Show AMsgDirection Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods showsPrec :: Int -> AMsgDirection -> ShowS show :: AMsgDirection -> String showList :: [AMsgDirection] -> ShowS | |
| FromField AMsgDirection Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods fromField :: FieldParser AMsgDirection # | |
toMsgDirection :: forall (d :: MsgDirection). SMsgDirection d -> MsgDirection Source #
class MsgDirectionI (d :: MsgDirection) where Source #
Methods
msgDirection :: SMsgDirection d Source #
Instances
| MsgDirectionI 'MDRcv Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods | |
| MsgDirectionI 'MDSnd Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods | |
checkDirection :: forall t (d :: MsgDirection) (d' :: MsgDirection). (MsgDirectionI d, MsgDirectionI d') => t d' -> Either String (t d) Source #
msgDirectionInt :: MsgDirection -> Int Source #
msgDirectionIntP :: Int64 -> Maybe MsgDirection Source #
data CIDeleteMode Source #
Constructors
| CIDMBroadcast | |
| CIDMInternal | |
| CIDMInternalMark |
Instances
| FromJSON CIDeleteMode Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods parseJSON :: Value -> Parser CIDeleteMode parseJSONList :: Value -> Parser [CIDeleteMode] omittedField :: Maybe CIDeleteMode | |
| ToJSON CIDeleteMode Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods toJSON :: CIDeleteMode -> Value toEncoding :: CIDeleteMode -> Encoding toJSONList :: [CIDeleteMode] -> Value toEncodingList :: [CIDeleteMode] -> Encoding omitField :: CIDeleteMode -> Bool | |
| Show CIDeleteMode Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods showsPrec :: Int -> CIDeleteMode -> ShowS show :: CIDeleteMode -> String showList :: [CIDeleteMode] -> ShowS | |
| StrEncoding CIDeleteMode Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods strEncode :: CIDeleteMode -> ByteString strDecode :: ByteString -> Either String CIDeleteMode strP :: Parser CIDeleteMode | |
ciDeleteModeToText :: CIDeleteMode -> Text Source #
data CIContent (d :: MsgDirection) where Source #
This type is used both in API and in DB, so we use different JSON encodings for the database and for the API ! ^ Nested sum types also have to use different encodings for database and API ! ^ to avoid breaking cross-platform compatibility, see RcvGroupEvent and SndGroupEvent
Constructors
Instances
| MsgDirectionI d => FromJSON (CIContent d) Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods parseJSON :: Value -> Parser (CIContent d) parseJSONList :: Value -> Parser [CIContent d] omittedField :: Maybe (CIContent d) | |
| MsgDirectionI d => ToJSON (CIContent d) Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods toJSON :: CIContent d -> Value toEncoding :: CIContent d -> Encoding toJSONList :: [CIContent d] -> Value toEncodingList :: [CIContent d] -> Encoding | |
| Show (CIContent d) Source # | |
| MsgDirectionI d => ToField (CIContent d) Source # | |
Defined in Simplex.Chat.Messages.CIContent | |
Instances
| FromJSON E2EInfo Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods parseJSON :: Value -> Parser E2EInfo parseJSONList :: Value -> Parser [E2EInfo] omittedField :: Maybe E2EInfo | |
| ToJSON E2EInfo Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods toEncoding :: E2EInfo -> Encoding toJSONList :: [E2EInfo] -> Value toEncodingList :: [E2EInfo] -> Encoding | |
| Show E2EInfo Source # | |
| Eq E2EInfo Source # | |
ciMsgContent :: forall (d :: MsgDirection). CIContent d -> Maybe MsgContent Source #
isCIReport :: forall (d :: MsgDirection). CIContent d -> Bool Source #
data MsgDecryptError Source #
Instances
| FromJSON MsgDecryptError Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods parseJSON :: Value -> Parser MsgDecryptError parseJSONList :: Value -> Parser [MsgDecryptError] omittedField :: Maybe MsgDecryptError | |
| ToJSON MsgDecryptError Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods toJSON :: MsgDecryptError -> Value toEncoding :: MsgDecryptError -> Encoding toJSONList :: [MsgDecryptError] -> Value toEncodingList :: [MsgDecryptError] -> Encoding omitField :: MsgDecryptError -> Bool | |
| Show MsgDecryptError Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods showsPrec :: Int -> MsgDecryptError -> ShowS show :: MsgDecryptError -> String showList :: [MsgDecryptError] -> ShowS | |
| Eq MsgDecryptError Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods (==) :: MsgDecryptError -> MsgDecryptError -> Bool (/=) :: MsgDecryptError -> MsgDecryptError -> Bool | |
ciRequiresAttention :: forall (d :: MsgDirection). MsgDirectionI d => CIContent d -> Bool Source #
newtype DBMsgErrorType Source #
Constructors
| DBME MsgErrorType |
Instances
| FromJSON DBMsgErrorType Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods parseJSON :: Value -> Parser DBMsgErrorType parseJSONList :: Value -> Parser [DBMsgErrorType] omittedField :: Maybe DBMsgErrorType | |
| ToJSON DBMsgErrorType Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods toJSON :: DBMsgErrorType -> Value toEncoding :: DBMsgErrorType -> Encoding toJSONList :: [DBMsgErrorType] -> Value toEncodingList :: [DBMsgErrorType] -> Encoding omitField :: DBMsgErrorType -> Bool | |
data CIGroupInvitation Source #
Constructors
| CIGroupInvitation | |
Fields | |
Instances
| FromJSON CIGroupInvitation Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods parseJSON :: Value -> Parser CIGroupInvitation parseJSONList :: Value -> Parser [CIGroupInvitation] omittedField :: Maybe CIGroupInvitation | |
| ToJSON CIGroupInvitation Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods toJSON :: CIGroupInvitation -> Value toEncoding :: CIGroupInvitation -> Encoding toJSONList :: [CIGroupInvitation] -> Value toEncodingList :: [CIGroupInvitation] -> Encoding omitField :: CIGroupInvitation -> Bool | |
| Show CIGroupInvitation Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods showsPrec :: Int -> CIGroupInvitation -> ShowS show :: CIGroupInvitation -> String showList :: [CIGroupInvitation] -> ShowS | |
| Eq CIGroupInvitation Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods (==) :: CIGroupInvitation -> CIGroupInvitation -> Bool (/=) :: CIGroupInvitation -> CIGroupInvitation -> Bool | |
data CIGroupInvitationStatus Source #
Constructors
| CIGISPending | |
| CIGISAccepted | |
| CIGISRejected | |
| CIGISExpired |
Instances
ciContentToText :: forall (d :: MsgDirection). CIContent d -> Text Source #
directE2EInfoToText :: E2EInfo -> Text Source #
groupE2EInfoToText :: E2EInfo -> Text Source #
simpleE2EText :: Text Source #
e2eInfoNoPQText :: Text Source #
e2eInfoPQText :: Text Source #
ciGroupInvitationToText :: CIGroupInvitation -> GroupMemberRole -> Text Source #
rcvDirectEventToText :: RcvDirectEvent -> Text Source #
rcvGroupEventToText :: RcvGroupEvent -> Text Source #
sndGroupEventToText :: SndGroupEvent -> Text Source #
pendingReviewMessage :: Text Source #
acceptedToGroupMessage :: Text Source #
rcvConnEventToText :: RcvConnEvent -> Text Source #
ratchetSyncStatusToText :: RatchetSyncState -> Text Source #
sndConnEventToText :: SndConnEvent -> Text Source #
profileToText :: Profile -> Text Source #
msgIntegrityError :: MsgErrorType -> Text Source #
msgDecryptErrorText :: MsgDecryptError -> Word32 -> Text Source #
msgDirToModeratedContent_ :: forall (d :: MsgDirection). SMsgDirection d -> CIContent d Source #
ciModeratedText :: Text Source #
data ACIContent Source #
Constructors
| MsgDirectionI d => ACIContent (SMsgDirection d) (CIContent d) |
Instances
| FromJSON ACIContent Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods parseJSON :: Value -> Parser ACIContent parseJSONList :: Value -> Parser [ACIContent] omittedField :: Maybe ACIContent | |
| Show ACIContent Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods showsPrec :: Int -> ACIContent -> ShowS show :: ACIContent -> String showList :: [ACIContent] -> ShowS | |
data JSONCIContent Source #
Constructors
Instances
| FromJSON JSONCIContent Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods parseJSON :: Value -> Parser JSONCIContent parseJSONList :: Value -> Parser [JSONCIContent] omittedField :: Maybe JSONCIContent | |
| ToJSON JSONCIContent Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods toJSON :: JSONCIContent -> Value toEncoding :: JSONCIContent -> Encoding toJSONList :: [JSONCIContent] -> Value toEncodingList :: [JSONCIContent] -> Encoding omitField :: JSONCIContent -> Bool | |
jsonCIContent :: forall (d :: MsgDirection). MsgDirectionI d => CIContent d -> JSONCIContent Source #
data DBJSONCIContent Source #
Constructors
Instances
| FromJSON DBJSONCIContent Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods parseJSON :: Value -> Parser DBJSONCIContent parseJSONList :: Value -> Parser [DBJSONCIContent] omittedField :: Maybe DBJSONCIContent | |
| ToJSON DBJSONCIContent Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods toJSON :: DBJSONCIContent -> Value toEncoding :: DBJSONCIContent -> Encoding toJSONList :: [DBJSONCIContent] -> Value toEncodingList :: [DBJSONCIContent] -> Encoding omitField :: DBJSONCIContent -> Bool | |
dbJsonCIContent :: forall (d :: MsgDirection). MsgDirectionI d => CIContent d -> DBJSONCIContent Source #
data CICallStatus Source #
Constructors
| CISCallPending | |
| CISCallMissed | |
| CISCallRejected | |
| CISCallAccepted | |
| CISCallNegotiated | |
| CISCallProgress | |
| CISCallEnded | |
| CISCallError |
Instances
| FromJSON CICallStatus Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods parseJSON :: Value -> Parser CICallStatus parseJSONList :: Value -> Parser [CICallStatus] omittedField :: Maybe CICallStatus | |
| ToJSON CICallStatus Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods toJSON :: CICallStatus -> Value toEncoding :: CICallStatus -> Encoding toJSONList :: [CICallStatus] -> Value toEncodingList :: [CICallStatus] -> Encoding omitField :: CICallStatus -> Bool | |
| Show CICallStatus Source # | |
Defined in Simplex.Chat.Messages.CIContent Methods showsPrec :: Int -> CICallStatus -> ShowS show :: CICallStatus -> String showList :: [CICallStatus] -> ShowS | |
ciCallInfoText :: CICallStatus -> Int -> Text Source #
callComplete :: CICallStatus -> Bool Source #
dbParseACIContent :: Text -> Either String ACIContent Source #
sndMsgContentTag :: Text Source #
rcvMsgContentTag :: Text Source #
toCIContentTag :: forall (e :: MsgDirection). CIContent e -> Text Source #