Search in sources :

Example 1 with DecryptedApproveMember

use of org.signal.storageservice.protos.groups.local.DecryptedApproveMember in project Signal-Android by WhisperSystems.

the class DecryptedGroupUtil method applyPromoteRequestingMemberActions.

private static void applyPromoteRequestingMemberActions(DecryptedGroup.Builder builder, List<DecryptedApproveMember> promoteRequestingMembers) throws NotAbleToApplyGroupV2ChangeException {
    for (DecryptedApproveMember approvedMember : promoteRequestingMembers) {
        int index = indexOfUuidInRequestingList(builder.getRequestingMembersList(), approvedMember.getUuid());
        if (index == -1) {
            Log.w(TAG, "Deleted member on change not found in group");
            continue;
        }
        DecryptedRequestingMember requestingMember = builder.getRequestingMembers(index);
        Member.Role role = approvedMember.getRole();
        ensureKnownRole(role);
        builder.removeRequestingMembers(index).addMembers(DecryptedMember.newBuilder().setUuid(approvedMember.getUuid()).setProfileKey(requestingMember.getProfileKey()).setRole(role));
    }
}
Also used : DecryptedApproveMember(org.signal.storageservice.protos.groups.local.DecryptedApproveMember) DecryptedRequestingMember(org.signal.storageservice.protos.groups.local.DecryptedRequestingMember) DecryptedMember(org.signal.storageservice.protos.groups.local.DecryptedMember) DecryptedPendingMember(org.signal.storageservice.protos.groups.local.DecryptedPendingMember) Member(org.signal.storageservice.protos.groups.Member) DecryptedApproveMember(org.signal.storageservice.protos.groups.local.DecryptedApproveMember) DecryptedRequestingMember(org.signal.storageservice.protos.groups.local.DecryptedRequestingMember)

Aggregations

Member (org.signal.storageservice.protos.groups.Member)1 DecryptedApproveMember (org.signal.storageservice.protos.groups.local.DecryptedApproveMember)1 DecryptedMember (org.signal.storageservice.protos.groups.local.DecryptedMember)1 DecryptedPendingMember (org.signal.storageservice.protos.groups.local.DecryptedPendingMember)1 DecryptedRequestingMember (org.signal.storageservice.protos.groups.local.DecryptedRequestingMember)1