HomePhabricator
Diffusion Comm 68f2a923b7fc

[lib] Update `filterThreadPermissions` to handle `EDIT_THREAD_AVATAR`

Tags
None
Referenced Files
F469577: 7235d4.png
Apr 10 2023, 9:00 AM
File Not Attached
F469576: 8c2fa7.png
Apr 10 2023, 9:00 AM
File Not Attached
F469569: b47ff6.png
Apr 10 2023, 9:00 AM
File Not Attached
F469568: 23c3a7.png
Apr 10 2023, 9:00 AM
File Not Attached
Subscribers
None

Description

[lib] Update filterThreadPermissions to handle EDIT_THREAD_AVATAR

Summary:
We're going to exclude EDIT_THREAD_AVATAR permission from all clients for now. We'll add hasMinCodeVersion check once we have a native release with thread avatar editing enabled.

Depends on D7363 and shows how it can be extended to handle new permissions fairly easily.

Test Plan:

  1. Set breakpoint before filter serverMember.permissions and see that it includes `EDIT_THREAD_AVATAR:

23c3a7.png (1×2 px, 633 KB)

  1. Set breakpoint after and see that memberPermissions is missing thread_edit_avatar permission:

b47ff6.png (1×2 px, 885 KB)


  1. Set filterThreadEditAvatarPermission to false and ensure that edit_thread_avatar is included in threadInfos[123].members[456].permissions after logging on:

8c2fa7.png (1×1 px, 308 KB)

(second field from bottom)

  1. Set filterThreadEditAvatarPermission back to true and ensure that edit_thread_avatar is not included in threadInfos[123].members[456].permissions after logging on:

7235d4.png (1×966 px, 280 KB)

Reviewers: ashoat, ginsu, rohan

Reviewed By: ashoat, rohan

Subscribers: rohan, tomek

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

Details

Provenance
atulAuthored on Apr 8 2023, 7:15 PM
Reviewer
ashoat
Differential Revision
D7364: [lib] Update `filterThreadPermissions` to handle `EDIT_THREAD_AVATAR`
Parents
rCOMMc6043c4fa5cf: [keyserver] Add keyserver/certs to .gitignore
Branches
Unknown
Tags
Unknown