mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-25 09:54:22 +00:00
toGroupKeys
This commit is contained in:
@@ -676,7 +676,8 @@ toGroupInfo vr userContactId chatTags ((groupId, localDisplayName, displayName,
|
||||
let membership = (toGroupMember userContactId userMemberRow) {memberChatVRange = vr}
|
||||
chatSettings = ChatSettings {enableNtfs = fromMaybe MFAll enableNtfs_, sendRcpts = unBI <$> sendRcpts, favorite}
|
||||
fullGroupPreferences = mergeGroupPreferences groupPreferences
|
||||
(sharedGroupId, groupKeys) = toGroupKeys groupKeysRow
|
||||
groupKeys = toGroupKeys groupKeysRow
|
||||
sharedGroupId = (\GroupKeys {sharedGroupId = gId} -> gId) <$> groupKeys
|
||||
groupProfile = GroupProfile {displayName, fullName, shortDescr, description, image, groupPreferences, memberAdmission, groupLink, sharedGroupId}
|
||||
businessChat = toBusinessChatInfo businessRow
|
||||
preparedGroup = toPreparedGroup preparedGroupRow
|
||||
@@ -689,14 +690,12 @@ toPreparedGroup = \case
|
||||
Just PreparedGroup {connLinkToConnect = CCLink fullLink shortLink_, connLinkPreparedConnection, connLinkStartedConnection, welcomeSharedMsgId, requestSharedMsgId}
|
||||
_ -> Nothing
|
||||
|
||||
toGroupKeys :: GroupKeysRow -> (Maybe B64UrlByteString, Maybe GroupKeys)
|
||||
toGroupKeys :: GroupKeysRow -> Maybe GroupKeys
|
||||
toGroupKeys = \case
|
||||
(Just sharedGroupId, rootPrivKey_, rootPubKey_, Just memberPrivKey) ->
|
||||
( Just sharedGroupId,
|
||||
(\grk -> GroupKeys {sharedGroupId, groupRootKey = grk, memberPrivKey})
|
||||
<$> (GRKPrivate <$> rootPrivKey_ <|> GRKPublic <$> rootPubKey_)
|
||||
)
|
||||
_ -> (Nothing, Nothing)
|
||||
(\grk -> GroupKeys {sharedGroupId, groupRootKey = grk, memberPrivKey})
|
||||
<$> (GRKPrivate <$> rootPrivKey_ <|> GRKPublic <$> rootPubKey_)
|
||||
_ -> Nothing
|
||||
|
||||
toGroupMember :: Int64 -> GroupMemberRow -> GroupMember
|
||||
toGroupMember userContactId ((groupMemberId, groupId, indexInGroup, memberId, minVer, maxVer, memberRole, memberCategory, memberStatus, BI showMessages, memberRestriction_) :. (invitedById, invitedByGroupMemberId, localDisplayName, memberContactId, memberContactProfileId) :. profileRow :. (createdAt, updatedAt) :. (supportChatTs_, supportChatUnread, supportChatMemberAttention, supportChatMentions, supportChatLastMsgFromMemberTs, memberPubKey, relayLink)) =
|
||||
|
||||
Reference in New Issue
Block a user