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));
}
}
Aggregations