Repository navigation
Add prepare_group_admin_change for group admin actions - #36
Open
santiagomed wants to merge 10 commits into
Open
santiagomed wants to merge 10 commits into
santiagomed wants to merge 10 commits into
Conversation
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #35.
Adds a signer for admin actions on an existing group, available in every binding:
for_key_rotationunset)add_admins/remove_adminsuser_idsGroupChangeEvent.GroupAdminAddChange/GroupAdminRemoveChangeremove_membersuser_idsGroupChangeEvent.GroupMemberRemoveChangereject_join_requestsuser_idsGroupChangeEvent.GroupJoinRejectenable_invite_linkinvite_url, optionalexpires_at_msec,affiliate_idGroupChangeEvent.GroupInviteEnabledisable_invite_linkGroupChangeEvent.GroupInviteDisableEach call returns one
ActionSignature. Field numbers and names come from the repo's thrift schema, and the payloads match the existing verifier. Every action round-trips through it in the tests.API (builder pattern, additive only):
GroupAdminChangeParams::new(group_id, GroupAdminAction::AddAdmins { user_ids })withwith_identity.GroupAdminAction::from_partsbuilds an action from the flat form.prepare_group_admin_change(conversation_id, action, *, user_ids=None, invite_url=None, expires_at_msec=None, affiliate_id=None, sender_id=None, signing_key_version=None)prepareGroupAdminChange({ conversationId, action, userIds, inviteUrl, expiresAtMsec, affiliateId })PrepareGroupAdminChange(GroupAdminChangeParams{…})withAdminAction…constantsGroupAdminActionenum plus optional fieldsInput is rejected with an error that says what to pass when:
g…)user_idsis empty or has empty, duplicate, or comma-containing entriesinvite_urlis empty or contains a comma (percent-encode it as%2C)expires_at_msecis not positiveaffiliate_idis emptyexpiresAtMsecis not a whole number (JS), or the action is an undefined enum value or null (.NET / JVM)The docs and the method doc comments say that removing members does not rotate the conversation key. Callers follow up with
prepare_conversation_key_change.Not included:
Docs:
docs/API.mdgets a table row and aprepare_group_admin_changesection with Rust/JS/Python snippets. The exampleChatCorewrappers in all six languages get aprepare_admin_changehelper.Tests
make ci(fmt, clippy-D warnings, license check, workspace tests): 568 core tests pass, 6 of them new.