Handle legacy hangup properly.

This commit is contained in:
Jim Gustafson 2020-06-06 17:15:03 -07:00 committed by Greyson Parrelli
parent d33873d59a
commit ed13c97ad7

View File

@ -547,8 +547,11 @@ public final class SignalServiceContent {
} }
return SignalServiceCallMessage.forIceUpdates(iceUpdates, isMultiRing, destinationDeviceId); return SignalServiceCallMessage.forIceUpdates(iceUpdates, isMultiRing, destinationDeviceId);
} else if (content.hasLegacyHangup()) {
SignalServiceProtos.CallMessage.Hangup hangup = content.getLegacyHangup();
return SignalServiceCallMessage.forHangup(new HangupMessage(hangup.getId(), HangupMessage.Type.fromProto(hangup.getType()), hangup.getDeviceId(), content.hasLegacyHangup()), isMultiRing, destinationDeviceId);
} else if (content.hasHangup()) { } else if (content.hasHangup()) {
SignalServiceProtos.CallMessage.Hangup hangup = content.hasLegacyHangup() ? content.getLegacyHangup() : content.getHangup(); SignalServiceProtos.CallMessage.Hangup hangup = content.getHangup();
return SignalServiceCallMessage.forHangup(new HangupMessage(hangup.getId(), HangupMessage.Type.fromProto(hangup.getType()), hangup.getDeviceId(), content.hasLegacyHangup()), isMultiRing, destinationDeviceId); return SignalServiceCallMessage.forHangup(new HangupMessage(hangup.getId(), HangupMessage.Type.fromProto(hangup.getType()), hangup.getDeviceId(), content.hasLegacyHangup()), isMultiRing, destinationDeviceId);
} else if (content.hasBusy()) { } else if (content.hasBusy()) {
SignalServiceProtos.CallMessage.Busy busy = content.getBusy(); SignalServiceProtos.CallMessage.Busy busy = content.getBusy();