use of org.thoughtcrime.securesms.ringrtc.RemotePeer in project Signal-Android by WhisperSystems.
the class MessageContentProcessor method handleCallHangupMessage.
private void handleCallHangupMessage(@NonNull SignalServiceContent content, @NonNull HangupMessage message, @NonNull Optional<Long> smsMessageId, @NonNull Recipient senderRecipient) {
log(String.valueOf(content), "handleCallHangupMessage");
if (smsMessageId.isPresent()) {
SignalDatabase.sms().markAsMissedCall(smsMessageId.get(), false);
} else {
RemotePeer remotePeer = new RemotePeer(senderRecipient.getId(), new CallId(message.getId()));
ApplicationDependencies.getSignalCallManager().receivedCallHangup(new WebRtcData.CallMetadata(remotePeer, content.getSenderDevice()), new WebRtcData.HangupMetadata(message.getType(), message.isLegacy(), message.getDeviceId()));
}
}
use of org.thoughtcrime.securesms.ringrtc.RemotePeer in project Signal-Android by WhisperSystems.
the class ActiveCallActionProcessorDelegate method handleRemoteVideoEnable.
@Override
@NonNull
protected WebRtcServiceState handleRemoteVideoEnable(@NonNull WebRtcServiceState currentState, boolean enable) {
RemotePeer activePeer = currentState.getCallInfoState().requireActivePeer();
Log.i(tag, "handleRemoteVideoEnable(): call_id: " + activePeer.getCallId());
CallParticipant oldParticipant = Objects.requireNonNull(currentState.getCallInfoState().getRemoteCallParticipant(activePeer.getRecipient()));
CallParticipant newParticipant = oldParticipant.withVideoEnabled(enable);
return currentState.builder().changeCallInfoState().putParticipant(activePeer.getRecipient(), newParticipant).build();
}
use of org.thoughtcrime.securesms.ringrtc.RemotePeer in project Signal-Android by signalapp.
the class MessageContentProcessor method handleCallAnswerMessage.
private void handleCallAnswerMessage(@NonNull SignalServiceContent content, @NonNull AnswerMessage message, @NonNull Recipient senderRecipient) {
log(String.valueOf(content), "handleCallAnswerMessage...");
RemotePeer remotePeer = new RemotePeer(senderRecipient.getId(), new CallId(message.getId()));
byte[] remoteIdentityKey = ApplicationDependencies.getProtocolStore().aci().identities().getIdentityRecord(senderRecipient.getId()).transform(record -> record.getIdentityKey().serialize()).orNull();
ApplicationDependencies.getSignalCallManager().receivedAnswer(new WebRtcData.CallMetadata(remotePeer, content.getSenderDevice()), new WebRtcData.AnswerMetadata(message.getOpaque(), message.getSdp()), new WebRtcData.ReceivedAnswerMetadata(remoteIdentityKey, content.getCallMessage().get().isMultiRing()));
}
use of org.thoughtcrime.securesms.ringrtc.RemotePeer in project Signal-Android by signalapp.
the class MessageContentProcessor method handleCallOfferMessage.
private void handleCallOfferMessage(@NonNull SignalServiceContent content, @NonNull OfferMessage message, @NonNull Optional<Long> smsMessageId, @NonNull Recipient senderRecipient) {
log(String.valueOf(content.getTimestamp()), "handleCallOfferMessage...");
if (smsMessageId.isPresent()) {
MessageDatabase database = SignalDatabase.sms();
database.markAsMissedCall(smsMessageId.get(), message.getType() == OfferMessage.Type.VIDEO_CALL);
} else {
RemotePeer remotePeer = new RemotePeer(senderRecipient.getId(), new CallId(message.getId()));
byte[] remoteIdentityKey = ApplicationDependencies.getProtocolStore().aci().identities().getIdentityRecord(senderRecipient.getId()).transform(record -> record.getIdentityKey().serialize()).orNull();
ApplicationDependencies.getSignalCallManager().receivedOffer(new WebRtcData.CallMetadata(remotePeer, content.getSenderDevice()), new WebRtcData.OfferMetadata(message.getOpaque(), message.getSdp(), message.getType()), new WebRtcData.ReceivedOfferMetadata(remoteIdentityKey, content.getServerReceivedTimestamp(), content.getServerDeliveredTimestamp(), content.getCallMessage().get().isMultiRing()));
}
}
use of org.thoughtcrime.securesms.ringrtc.RemotePeer in project Signal-Android by signalapp.
the class MessageContentProcessor method handleCallHangupMessage.
private void handleCallHangupMessage(@NonNull SignalServiceContent content, @NonNull HangupMessage message, @NonNull Optional<Long> smsMessageId, @NonNull Recipient senderRecipient) {
log(String.valueOf(content), "handleCallHangupMessage");
if (smsMessageId.isPresent()) {
SignalDatabase.sms().markAsMissedCall(smsMessageId.get(), false);
} else {
RemotePeer remotePeer = new RemotePeer(senderRecipient.getId(), new CallId(message.getId()));
ApplicationDependencies.getSignalCallManager().receivedCallHangup(new WebRtcData.CallMetadata(remotePeer, content.getSenderDevice()), new WebRtcData.HangupMetadata(message.getType(), message.isLegacy(), message.getDeviceId()));
}
}
Aggregations