pub struct GroupOperations {
pub group_secret_params: GroupSecretParams,
}Fields§
§group_secret_params: GroupSecretParamsImplementations§
Source§impl GroupOperations
impl GroupOperations
pub fn encrypt_title<R: Rng + CryptoRng>( &self, title: &str, rng: &mut R, ) -> Vec<u8> ⓘ
pub fn encrypt_description<R: Rng + CryptoRng>( &self, description: Option<&str>, rng: &mut R, ) -> Vec<u8> ⓘ
pub fn encrypt_disappearing_messages_timer<R: Rng + CryptoRng>( &self, timer: Option<&Timer>, rng: &mut R, ) -> Vec<u8> ⓘ
pub fn new(group_secret_params: GroupSecretParams) -> Self
pub fn decrypt_group(&self, group: Group) -> Result<Group, GroupDecodingError>
pub fn decrypt_group_change( &self, group_change: GroupChange, ) -> Result<GroupChanges, GroupDecodingError>
pub fn decrypt_avatar(&self, ciphertext: &[u8]) -> Option<Vec<u8>>
Sourcepub fn build_add_member_action(
&self,
aci: Aci,
profile_key: ProfileKey,
role: Role,
) -> Result<AddMemberAction, GroupDecodingError>
pub fn build_add_member_action( &self, aci: Aci, profile_key: ProfileKey, role: Role, ) -> Result<AddMemberAction, GroupDecodingError>
Build an AddMemberAction for a GroupChange.
§Role Parameter
The role parameter is accepted for API consistency, but note that
Signal-Android only ever adds members with Role::Default. Adding a member
with Role::Administrator is an illegal operation that the server will reject.
Promotion to administrator requires a separate ModifyMemberRoleAction after
the member has been added.
See Signal-Android’s GroupsV2Operations.GroupOperations.createModifyGroupMembershipChange()
which hardcodes Member.Role newMemberRole = Member.Role.DEFAULT.
Sourcepub fn build_remove_member_action(
&self,
aci: Aci,
) -> Result<DeleteMemberAction, GroupDecodingError>
pub fn build_remove_member_action( &self, aci: Aci, ) -> Result<DeleteMemberAction, GroupDecodingError>
Build a DeleteMemberAction for a GroupChange
Sourcepub fn build_remove_pending_member_action(
&self,
invitee: ServiceId,
) -> Result<DeleteMemberPendingProfileKeyAction, GroupDecodingError>
pub fn build_remove_pending_member_action( &self, invitee: ServiceId, ) -> Result<DeleteMemberPendingProfileKeyAction, GroupDecodingError>
Build a DeletePendingMemberAction to retract an outstanding invitation.
Used when a pending member (invite not yet accepted) is to be removed.
The invitee may be ACI or PNI — whichever service ID was used when
the invite was originally created. The Signal server stores and matches
on the encrypted user_id field of PendingMember, which may be
either kind of ServiceId.
Sourcepub fn create_member_presentation(
&self,
server_public_params: &ServerPublicParams,
credential: &ExpiringProfileKeyCredential,
) -> Vec<u8> ⓘ
pub fn create_member_presentation( &self, server_public_params: &ServerPublicParams, credential: &ExpiringProfileKeyCredential, ) -> Vec<u8> ⓘ
Create a presentation from a credential for adding a member to a group.
This creates a ZK proof (ExpiringProfileKeyCredentialPresentation) that the Signal server can verify to validate the member’s identity and profile key.
Sourcepub fn encrypt_group_with_credentials<R: Rng + CryptoRng>(
&self,
title: &str,
description: Option<&str>,
disappearing_messages_timer: Option<&Timer>,
access_control: Option<&AccessControl>,
self_credential: &ExpiringProfileKeyCredential,
member_candidates: &[GroupMemberCandidate],
server_public_params: &ServerPublicParams,
avatar_url: String,
rng: &mut R,
) -> Result<Group, GroupDecodingError>
pub fn encrypt_group_with_credentials<R: Rng + CryptoRng>( &self, title: &str, description: Option<&str>, disappearing_messages_timer: Option<&Timer>, access_control: Option<&AccessControl>, self_credential: &ExpiringProfileKeyCredential, member_candidates: &[GroupMemberCandidate], server_public_params: &ServerPublicParams, avatar_url: String, rng: &mut R, ) -> Result<Group, GroupDecodingError>
Encrypt a group for creation, using credentials for member presentations.
This method properly populates the presentation field for members with
credentials, which is required by the Signal server for group creation.
Members with credentials get added with presentations (full members). Members without credentials get added as pending invites.
§Arguments
title- The group titledescription- Optional group descriptiondisappearing_messages_timer- Optional disappearing messages timeraccess_control- Optional access control settingsself_credential- The creator’s own credential (required)avatar_url- The group avatar URLmember_candidates- Other members to add, with optional credentialsserver_public_params- Server public params for creating presentationsrng- Random number generator
Sourcepub fn build_add_member_action_with_credential(
&self,
credential: &ExpiringProfileKeyCredential,
role: Role,
server_public_params: &ServerPublicParams,
) -> AddMemberAction
pub fn build_add_member_action_with_credential( &self, credential: &ExpiringProfileKeyCredential, role: Role, server_public_params: &ServerPublicParams, ) -> AddMemberAction
Build an AddMemberAction with a credential presentation for a GroupChange.
This is used when adding members to an existing group with proper ZK proofs.
§Role Parameter
The role parameter is accepted for API consistency, but note that
Signal-Android only ever adds members with Role::Default. Adding a member
with Role::Administrator is an illegal operation that the server will reject.
Promotion to administrator requires a separate ModifyMemberRoleAction after
the member has been added.
Sourcepub fn build_add_pending_member_action(
&self,
invitee: ServiceId,
added_by_aci: Aci,
role: Role,
) -> Result<AddMemberPendingProfileKeyAction, GroupDecodingError>
pub fn build_add_pending_member_action( &self, invitee: ServiceId, added_by_aci: Aci, role: Role, ) -> Result<AddMemberPendingProfileKeyAction, GroupDecodingError>
Build an AddPendingMemberAction to invite a member without their profile key.
This adds the member as a pending invite. They will receive a group invite notification and must accept to become a full member. No profile key is needed.
The invitee may be either an ACI or a PNI. When only a PNI is known (e.g.
the invitee has ACI disclosure disabled in CDSI), passing ServiceId::Pni
allows the pending-invite path to proceed without an ACI. The Signal server
stores whichever service ID is provided in the encrypted user_id field of
the PendingMember proto. The added_by_aci must always be an ACI.
§Role Parameter
The role parameter is accepted for API consistency, but note that
Signal-Android only ever adds pending members with Role::Default.
Auto Trait Implementations§
impl Freeze for GroupOperations
impl RefUnwindSafe for GroupOperations
impl Send for GroupOperations
impl Sync for GroupOperations
impl Unpin for GroupOperations
impl UnwindSafe for GroupOperations
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].