From e2f98f6bbc819bbacd96d7b4e69aef7f740de745 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 22 Nov 2022 10:13:07 +0100 Subject: [PATCH] ensure cc-ed proceed is equivalent to accept --- .../xmpp/jingle/JingleRtpConnection.java | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java index 0c68f663c..ad5aeac0e 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -952,16 +952,7 @@ public class JingleRtpConnection extends AbstractJingleConnection from.asBareJid().equals(id.account.getJid().asBareJid()); if (originatedFromMyself) { if (transition(State.ACCEPTED)) { - if (serverMsgId != null) { - this.message.setServerMsgId(serverMsgId); - } - this.message.setTime(timestamp); - this.message.setCarbon(true); // indicate that call was accepted on other device - this.writeLogMessageSuccess(0); - this.xmppConnectionService - .getNotificationService() - .cancelIncomingCallNotification(); - this.finish(); + acceptedOnOtherDevice(serverMsgId, timestamp); } else { Log.d( Config.LOGTAG, @@ -976,6 +967,19 @@ public class JingleRtpConnection extends AbstractJingleConnection } } + private void acceptedOnOtherDevice(final String serverMsgId, final long timestamp) { + if (serverMsgId != null) { + this.message.setServerMsgId(serverMsgId); + } + this.message.setTime(timestamp); + this.message.setCarbon(true); // indicate that call was accepted on other device + this.writeLogMessageSuccess(0); + this.xmppConnectionService + .getNotificationService() + .cancelIncomingCallNotification(); + this.finish(); + } + private void receiveReject(final Jid from, final String serverMsgId, final long timestamp) { final boolean originatedFromMyself = from.asBareJid().equals(id.account.getJid().asBareJid()); @@ -1173,11 +1177,8 @@ public class JingleRtpConnection extends AbstractJingleConnection id.account.getJid().asBareJid() + ": moved session with " + id.with - + " into state accepted after received carbon copied procced"); - this.xmppConnectionService - .getNotificationService() - .cancelIncomingCallNotification(); - this.finish(); + + " into state accepted after received carbon copied proceed"); + acceptedOnOtherDevice(serverMsgId, timestamp); } } else { Log.d(