use of org.signal.storageservice.protos.groups.GroupExternalCredential in project Signal-Android by signalapp.
the class SignalCallManager method requestMembershipProof.
@Override
public void requestMembershipProof(@NonNull final GroupCall groupCall) {
Log.i(TAG, "requestMembershipProof():");
Recipient recipient = serviceState.getCallInfoState().getCallRecipient();
if (!recipient.isPushV2Group()) {
Log.i(TAG, "Request membership proof for non-group");
return;
}
GroupCall currentGroupCall = serviceState.getCallInfoState().getGroupCall();
if (currentGroupCall == null || currentGroupCall.hashCode() != groupCall.hashCode()) {
Log.i(TAG, "Skipping group membership proof request, requested group call does not match current group call");
return;
}
networkExecutor.execute(() -> {
try {
GroupExternalCredential credential = GroupManager.getGroupExternalCredential(context, recipient.getGroupId().get().requireV2());
process((s, p) -> p.handleGroupRequestMembershipProof(s, groupCall.hashCode(), credential.getTokenBytes().toByteArray()));
} catch (IOException e) {
Log.w(TAG, "Unable to get group membership proof from service", e);
onEnded(groupCall, GroupCall.GroupCallEndReason.SFU_CLIENT_FAILED_TO_JOIN);
} catch (VerificationFailedException e) {
Log.w(TAG, "Unable to verify group membership proof", e);
onEnded(groupCall, GroupCall.GroupCallEndReason.DEVICE_EXPLICITLY_DISCONNECTED);
}
});
}
Aggregations