Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5-internal/group-id-subconv-2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
change version and conversation type to 16 bit in group ID serialisation
8 changes: 4 additions & 4 deletions libs/wire-api/src/Wire/API/MLS/Group/Serialisation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ convToGroupId :: GroupIdParts -> GroupId
convToGroupId parts = GroupId . L.toStrict . runPut $ do
let cs = qUnqualified parts.qConvId
subId = foldMap unSubConvId cs.subconv
putWord64be 1 -- Version 1 of the GroupId format
putWord32be (fromIntegral $ fromEnum parts.convType)
putWord16be 1 -- Version 1 of the GroupId format
putWord16be (fromIntegral $ fromEnum parts.convType)
putLazyByteString . UUID.toByteString . toUUID $ cs.conv
putWord8 $ fromIntegral (T.length subId)
putByteString $ T.encodeUtf8 subId
Expand All @@ -82,8 +82,8 @@ groupIdToConv gid = do
}
where
readConv = do
version <- getWord64be
ct <- getWord32be
version <- getWord16be
ct <- getWord16be
unless (version == 1) $ fail "unsupported groupId version"
mUUID <- UUID.fromByteString . L.fromStrict <$> getByteString 16
uuid <- maybe (fail "invalid conversation UUID in groupId") pure mUUID
Expand Down