depulicate 'propose's when doing mam catchup

This commit is contained in:
Daniel Gultsch 2020-04-14 09:06:07 +02:00
parent e16e0d895e
commit 172d2c693f
3 changed files with 59 additions and 51 deletions

View file

@ -92,8 +92,8 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 28 targetSdkVersion 28
versionCode 368 versionCode 369
versionName "2.8.0-alpha.2" versionName "2.8.0-alpha.3"
archivesBaseName += "-$versionName" archivesBaseName += "-$versionName"
applicationId "eu.siacs.conversations" applicationId "eu.siacs.conversations"
resValue "string", "applicationId", applicationId resValue "string", "applicationId", applicationId

View file

@ -854,6 +854,12 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece
final String namespace = description == null ? null : description.getNamespace(); final String namespace = description == null ? null : description.getNamespace();
if (Namespace.JINGLE_APPS_RTP.equals(namespace)) { if (Namespace.JINGLE_APPS_RTP.equals(namespace)) {
final Conversation c = mXmppConnectionService.findOrCreateConversation(account, counterpart.asBareJid(), false, false); final Conversation c = mXmppConnectionService.findOrCreateConversation(account, counterpart.asBareJid(), false, false);
final Message preExistingMessage = c.findRtpSession(sessionId, status);
if (preExistingMessage != null) {
preExistingMessage.setServerMsgId(serverMsgId);
mXmppConnectionService.updateMessage(preExistingMessage);
break;
}
final Message message = new Message( final Message message = new Message(
c, c,
status, status,

View file

@ -349,8 +349,11 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
sendSessionAccept(offer); sendSessionAccept(offer);
} }
private void sendSessionAccept(SessionDescription offer) { private void sendSessionAccept(final SessionDescription offer) {
discoverIceServers(iceServers -> { discoverIceServers(iceServers -> sendSessionAccept(offer,iceServers));
}
private void sendSessionAccept(final SessionDescription offer, final List<PeerConnection.IceServer> iceServers) {
try { try {
setupWebRTC(iceServers); setupWebRTC(iceServers);
} catch (WebRTCWrapper.InitializationException e) { } catch (WebRTCWrapper.InitializationException e) {
@ -373,7 +376,6 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
Log.d(Config.LOGTAG, "unable to send session accept", e); Log.d(Config.LOGTAG, "unable to send session accept", e);
} }
});
} }
private void addIceCandidatesFromBlackLog() { private void addIceCandidatesFromBlackLog() {
@ -532,7 +534,10 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
private void sendSessionInitiate(final State targetState) { private void sendSessionInitiate(final State targetState) {
Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": prepare session-initiate"); Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": prepare session-initiate");
discoverIceServers(iceServers -> { discoverIceServers(iceServers -> sendSessionInitiate(targetState, iceServers));
}
private void sendSessionInitiate(final State targetState, final List<PeerConnection.IceServer> iceServers) {
try { try {
setupWebRTC(iceServers); setupWebRTC(iceServers);
} catch (WebRTCWrapper.InitializationException e) { } catch (WebRTCWrapper.InitializationException e) {
@ -556,14 +561,12 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
transitionOrThrow(State.TERMINATED_APPLICATION_FAILURE); transitionOrThrow(State.TERMINATED_APPLICATION_FAILURE);
} }
} }
});
} }
private void sendSessionInitiate(RtpContentMap rtpContentMap, final State targetState) { private void sendSessionInitiate(RtpContentMap rtpContentMap, final State targetState) {
this.initiatorRtpContentMap = rtpContentMap; this.initiatorRtpContentMap = rtpContentMap;
this.transitionOrThrow(targetState); this.transitionOrThrow(targetState);
final JinglePacket sessionInitiate = rtpContentMap.toJinglePacket(JinglePacket.Action.SESSION_INITIATE, id.sessionId); final JinglePacket sessionInitiate = rtpContentMap.toJinglePacket(JinglePacket.Action.SESSION_INITIATE, id.sessionId);
Log.d(Config.LOGTAG, sessionInitiate.toString());
send(sessionInitiate); send(sessionInitiate);
} }
@ -591,7 +594,6 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
return; return;
} }
final JinglePacket jinglePacket = transportInfo.toJinglePacket(JinglePacket.Action.TRANSPORT_INFO, id.sessionId); final JinglePacket jinglePacket = transportInfo.toJinglePacket(JinglePacket.Action.TRANSPORT_INFO, id.sessionId);
Log.d(Config.LOGTAG, jinglePacket.toString());
send(jinglePacket); send(jinglePacket);
} }