HomePhabricator
Diffusion Comm b18953404f67

[lib] Introduce `threadPermissionsFromBitmaskHex`

Description

[lib] Introduce threadPermissionsFromBitmaskHex

Summary:
This function will allow us to go from permissionBitmaskHex "back" to ThreadPermissionsInfo.

NOTE: Once we've made all the necessary changes on native we'll be able to remove this function altogether and use hasPermission(permissionsBitmaskHex:string, permission:ThreadPermission) instead. This is for incremental step where we send encoded permissions to native and web clients and IMMEDIATELY decode back to ThreadPermissionsInfo and ThreadRolePermissionsBlob. The diffs immediately after that will handle refactoring clients so we can "query" the minimal encoding directly.

Next diffs:

  • Higher level utilities for translating back/forth from RawThreadInfo <=> MinimallyEncodedRawThreadInfo
  • Native refactoring + migrations
  • Web refactoring
  • Flipping the switch

Test Plan: Unit test

Reviewers: ashoat, ginsu, tomek, rohan

Reviewed By: ashoat

Subscribers: wyilio

Differential Revision: https://phab.comm.dev/D9752

Details

Provenance
atulAuthored on Nov 7 2023, 12:08 PM
Reviewer
ashoat
Differential Revision
D9752: [lib] Introduce `threadPermissionsFromBitmaskHex`
Parents
rCOMM026cf43aad7b: [native] factor keyserver list item into its own component
Branches
Unknown
Tags
Unknown