core: members profile update, create profile update chat items (#3644)

This commit is contained in:
spaced4ndy
2024-01-15 19:56:11 +04:00
committed by GitHub
parent be0c791c43
commit f4f8501eb8
19 changed files with 777 additions and 77 deletions
+6 -1
View File
@@ -169,7 +169,9 @@ ciRequiresAttention content = case msgDirection @d of
CIRcvIntegrityError _ -> True
CIRcvDecryptionError {} -> True
CIRcvGroupInvitation {} -> True
CIRcvDirectEvent _ -> False
CIRcvDirectEvent rde -> case rde of
RDEContactDeleted -> False
RDEProfileUpdated {} -> True
CIRcvGroupEvent rge -> case rge of
RGEMemberAdded {} -> False
RGEMemberConnected -> False
@@ -182,6 +184,7 @@ ciRequiresAttention content = case msgDirection @d of
RGEGroupUpdated _ -> False
RGEInvitedViaGroupLink -> False
RGEMemberCreatedContact -> False
RGEMemberProfileUpdated {} -> False
CIRcvConnEvent _ -> True
CIRcvChatFeature {} -> False
CIRcvChatPreference {} -> False
@@ -252,6 +255,7 @@ ciGroupInvitationToText CIGroupInvitation {groupProfile = GroupProfile {displayN
rcvDirectEventToText :: RcvDirectEvent -> Text
rcvDirectEventToText = \case
RDEContactDeleted -> "contact deleted"
RDEProfileUpdated {} -> "updated profile"
rcvGroupEventToText :: RcvGroupEvent -> Text
rcvGroupEventToText = \case
@@ -266,6 +270,7 @@ rcvGroupEventToText = \case
RGEGroupUpdated _ -> "group profile updated"
RGEInvitedViaGroupLink -> "invited via your group link"
RGEMemberCreatedContact -> "started direct connection with you"
RGEMemberProfileUpdated {} -> "updated profile"
sndGroupEventToText :: SndGroupEvent -> Text
sndGroupEventToText = \case
@@ -25,6 +25,7 @@ data RcvGroupEvent
-- and be created as unread without adding / working around new status for sent items
| RGEInvitedViaGroupLink -- CRSentGroupInvitationViaLink
| RGEMemberCreatedContact -- CRNewMemberContactReceivedInv
| RGEMemberProfileUpdated {fromProfile :: Profile, toProfile :: Profile} -- CRGroupMemberUpdated
deriving (Show)
data SndGroupEvent
@@ -47,8 +48,8 @@ data SndConnEvent
deriving (Show)
data RcvDirectEvent
= -- RDEProfileChanged {...}
RDEContactDeleted
= RDEContactDeleted
| RDEProfileUpdated {fromProfile :: Profile, toProfile :: Profile} -- CRContactUpdated
deriving (Show)
-- platform-specific JSON encoding (used in API)