From 8374df84aa7388011796feeae0bf67a976d68d67 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 30 Apr 2020 09:06:43 +0200 Subject: [PATCH] do not change intent to retracted if end card had already been reached --- .../java/eu/siacs/conversations/ui/RtpSessionActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index 335063b2c..bd8972598 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -108,9 +108,13 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe private void retractSessionProposal() { final Intent intent = getIntent(); + final String action = intent.getAction(); final Account account = extractAccount(intent); final Jid with = Jid.of(intent.getStringExtra(EXTRA_WITH)); - resetIntent(account, with, RtpEndUserState.RETRACTED, actionToMedia(intent.getAction())); + final String state = intent.getStringExtra(EXTRA_LAST_REPORTED_STATE); + if (!Intent.ACTION_VIEW.equals(action) || state == null || !END_CARD.contains(RtpEndUserState.valueOf(state))) { + resetIntent(account, with, RtpEndUserState.RETRACTED, actionToMedia(intent.getAction())); + } xmppConnectionService.getJingleConnectionManager().retractSessionProposal(account, with.asBareJid()); }