Ignore rings from non-admins in announcement only groups and rev feature flag.

main
Cody Henthorne 2022-11-15 11:18:09 -05:00 zatwierdzone przez Alex Hart
rodzic fd37613f2f
commit c51e13fd30
5 zmienionych plików z 16 dodań i 11 usunięć

Wyświetl plik

@ -88,7 +88,7 @@ public class IdleActionProcessor extends WebRtcActionProcessor {
@NonNull RemotePeer remotePeerGroup,
@NonNull GroupId.V2 groupId,
long ringId,
@NonNull UUID uuid,
@NonNull UUID sender,
@NonNull CallManager.RingUpdate ringUpdate)
{
Log.i(TAG, "handleGroupCallRingUpdate(): recipient: " + remotePeerGroup.getId() + " ring: " + ringId + " update: " + ringUpdate);
@ -118,7 +118,7 @@ public class IdleActionProcessor extends WebRtcActionProcessor {
return currentState;
}
webRtcInteractor.peekGroupCallForRingingCheck(new GroupCallRingCheckInfo(remotePeerGroup.getId(), groupId, ringId, uuid, ringUpdate));
webRtcInteractor.peekGroupCallForRingingCheck(new GroupCallRingCheckInfo(remotePeerGroup.getId(), groupId, ringId, sender, ringUpdate));
return currentState;
}

Wyświetl plik

@ -49,7 +49,7 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro
@NonNull RemotePeer remotePeerGroup,
@NonNull GroupId.V2 groupId,
long ringId,
@NonNull UUID uuid,
@NonNull UUID sender,
@NonNull CallManager.RingUpdate ringUpdate)
{
Log.i(TAG, "handleGroupCallRingUpdate(): recipient: " + remotePeerGroup.getId() + " ring: " + ringId + " update: " + ringUpdate);
@ -138,7 +138,7 @@ public final class IncomingGroupCallActionProcessor extends DeviceAwareActionPro
.changeCallSetupState(RemotePeer.GROUP_CALL_ID)
.isRemoteVideoOffer(true)
.ringId(ringId)
.ringerRecipient(Recipient.externalPush(ServiceId.from(uuid)))
.ringerRecipient(Recipient.externalPush(ServiceId.from(sender)))
.commit()
.changeCallInfoState()
.activePeer(new RemotePeer(currentState.getCallInfoState().getCallRecipient().getId(), RemotePeer.GROUP_CALL_ID))

Wyświetl plik

@ -741,13 +741,18 @@ private void processStateless(@NonNull Function1<WebRtcEphemeralState, WebRtcEph
}
@Override
public void onGroupCallRingUpdate(@NonNull byte[] groupIdBytes, long ringId, @NonNull UUID uuid, @NonNull CallManager.RingUpdate ringUpdate) {
public void onGroupCallRingUpdate(@NonNull byte[] groupIdBytes, long ringId, @NonNull UUID sender, @NonNull CallManager.RingUpdate ringUpdate) {
try {
GroupId.V2 groupId = GroupId.v2(new GroupIdentifier(groupIdBytes));
GroupDatabase.GroupRecord group = SignalDatabase.groups().getGroup(groupId).orElse(null);
GroupId.V2 groupId = GroupId.v2(new GroupIdentifier(groupIdBytes));
GroupDatabase.GroupRecord group = SignalDatabase.groups().getGroup(groupId).orElse(null);
Recipient senderRecipient = Recipient.externalPush(ServiceId.from(sender));
if (group != null && group.isActive() && !Recipient.resolved(group.getRecipientId()).isBlocked()) {
process((s, p) -> p.handleGroupCallRingUpdate(s, new RemotePeer(group.getRecipientId()), groupId, ringId, uuid, ringUpdate));
if (group != null &&
group.isActive() &&
!Recipient.resolved(group.getRecipientId()).isBlocked() &&
(!group.isAnnouncementGroup() || group.isAdmin(senderRecipient)))
{
process((s, p) -> p.handleGroupCallRingUpdate(s, new RemotePeer(group.getRecipientId()), groupId, ringId, sender, ringUpdate));
} else {
Log.w(TAG, "Unable to ring unknown/inactive/blocked group.");
}

Wyświetl plik

@ -786,7 +786,7 @@ public abstract class WebRtcActionProcessor {
@NonNull RemotePeer remotePeerGroup,
@NonNull GroupId.V2 groupId,
long ringId,
@NonNull UUID uuid,
@NonNull UUID sender,
@NonNull RingUpdate ringUpdate)
{
Log.i(tag, "handleGroupCallRingUpdate(): recipient: " + remotePeerGroup.getId() + " ring: " + ringId + " update: " + ringUpdate);

Wyświetl plik

@ -80,7 +80,7 @@ public final class FeatureFlags {
private static final String SENDER_KEY_MAX_AGE = "android.senderKeyMaxAge";
private static final String RETRY_RECEIPTS = "android.retryReceipts";
private static final String MAX_GROUP_CALL_RING_SIZE = "global.calling.maxGroupCallRingSize";
private static final String GROUP_CALL_RINGING = "android.calling.groupCallRinging";
private static final String GROUP_CALL_RINGING = "android.calling.groupCallRinging.2";
private static final String STORIES_TEXT_FUNCTIONS = "android.stories.text.functions";
private static final String HARDWARE_AEC_BLOCKLIST_MODELS = "android.calling.hardwareAecBlockList";
private static final String SOFTWARE_AEC_BLOCKLIST_MODELS = "android.calling.softwareAecBlockList";