From 18dea352b05622978422605b6408765e71ac78c2 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 21 Jan 2024 14:48:07 +0100 Subject: [PATCH] send jmi finish alongside session terminate --- .../conversations/generator/MessageGenerator.java | 1 - .../conversations/xmpp/jingle/JingleRtpConnection.java | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java b/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java index 18322453e..e217f7f1d 100644 --- a/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java +++ b/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java @@ -234,7 +234,6 @@ public class MessageGenerator extends AbstractGenerator { final MessagePacket packet = new MessagePacket(); packet.setType(MessagePacket.TYPE_CHAT); packet.setTo(with); - packet.setId(JingleRtpConnection.JINGLE_MESSAGE_PROPOSE_ID_PREFIX + sessionId); final Element finish = packet.addChild("finish", Namespace.JINGLE_MESSAGE); finish.setAttribute("id", sessionId); final Element reasonElement = finish.addChild("reason", Namespace.JINGLE); 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 74eb4abd0..e22d6574e 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleRtpConnection.java @@ -1986,6 +1986,7 @@ public class JingleRtpConnection extends AbstractJingleConnection protected void sendSessionTerminate(final Reason reason, final String text) { sendSessionTerminate(reason, text, this::writeLogMessage); + sendJingleMessageFinish(reason); } private void sendTransportInfo( @@ -2358,6 +2359,15 @@ public class JingleRtpConnection extends AbstractJingleConnection xmppConnectionService.sendMessagePacket(id.account, messagePacket); } + private void sendJingleMessageFinish(final Reason reason) { + final var account = id.getAccount(); + final MessagePacket messagePacket = + xmppConnectionService + .getMessageGenerator() + .sessionFinish(id.with, id.sessionId, reason); + xmppConnectionService.sendMessagePacket(account, messagePacket); + } + private boolean isOmemoEnabled() { final Conversational conversational = message.getConversation(); if (conversational instanceof Conversation) {