Prevent starting 1:1 call with a group recipient.

This commit is contained in:
Cody Henthorne 2021-09-29 16:43:51 -04:00
parent 89df0a2c04
commit f40ba0bf68

View file

@ -8,6 +8,7 @@ import org.signal.ringrtc.CallManager;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.events.WebRtcViewModel;
import org.thoughtcrime.securesms.groups.GroupId;
import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.ringrtc.RemotePeer;
import org.thoughtcrime.securesms.service.webrtc.state.WebRtcServiceState;
import org.whispersystems.signalservice.api.messages.calls.OfferMessage;
@ -44,6 +45,12 @@ public class IdleActionProcessor extends WebRtcActionProcessor {
{
Log.i(TAG, "handleOutgoingCall():");
Recipient recipient = Recipient.resolved(remotePeer.getId());
if (recipient.isGroup()) {
Log.w(TAG, "Aborting attempt to start 1:1 call for group recipient: " + remotePeer.getId());
return currentState;
}
currentState = WebRtcVideoUtil.initializeVideo(context, webRtcInteractor.getCameraEventListener(), currentState);
return beginCallDelegate.handleOutgoingCall(currentState, remotePeer, offerType);
}