Skip to content

ServiceIds type #369

@rubdos

Description

@rubdos

In several places in storage backends, methods are called with both an Aci and Pni, where both are optional, but one of them needs to be set. Example:

    #[tracing::instrument(skip(self))]
    pub fn fetch_group_v2_pending_member(
        &self,
        id: &str,
        aci: Option<Aci>,
        pni: Option<Pni>,
    ) -> Option<orm::GroupV2PendingMember> {
        if aci.is_none() && pni.is_none() {

We probably want to provide a type ServiceIds (better name suggestion is welcome) like this:

enum ServiceIds {
    Aci(Aci),
    Pni(Pni),
    AciAndPni(Aci, Pni),
}

... together with a bunch of convenience conversion methods. Maybe this should even be a type in libsignal-protocol/core

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions