do not change intent to retracted if end card had already been reached

This commit is contained in:
Daniel Gultsch 2020-04-30 09:06:43 +02:00
parent f106cbccf5
commit 8374df84aa

View file

@ -108,9 +108,13 @@ public class RtpSessionActivity extends XmppActivity implements XmppConnectionSe
private void retractSessionProposal() { private void retractSessionProposal() {
final Intent intent = getIntent(); final Intent intent = getIntent();
final String action = intent.getAction();
final Account account = extractAccount(intent); final Account account = extractAccount(intent);
final Jid with = Jid.of(intent.getStringExtra(EXTRA_WITH)); final Jid with = Jid.of(intent.getStringExtra(EXTRA_WITH));
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())); resetIntent(account, with, RtpEndUserState.RETRACTED, actionToMedia(intent.getAction()));
}
xmppConnectionService.getJingleConnectionManager().retractSessionProposal(account, with.asBareJid()); xmppConnectionService.getJingleConnectionManager().retractSessionProposal(account, with.asBareJid());
} }