From 69425e677cde4a09f69a11b4c0549807b0d4cbb2 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 18 Oct 2023 18:18:16 +0200 Subject: [PATCH] remove soft disable flag when attempting call --- src/main/java/eu/siacs/conversations/entities/Account.java | 3 +++ .../java/eu/siacs/conversations/ui/ConversationFragment.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java index 0fdece061..3146abe46 100644 --- a/src/main/java/eu/siacs/conversations/entities/Account.java +++ b/src/main/java/eu/siacs/conversations/entities/Account.java @@ -258,6 +258,9 @@ public class Account extends AbstractEntity implements AvatarService.Avatarable } public boolean setOption(final int option, final boolean value) { + if (value && (option == OPTION_DISABLED || option == OPTION_SOFT_DISABLED)) { + this.setStatus(State.OFFLINE); + } final int before = this.options; if (value) { this.options |= 1 << option; diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 6063d613e..096a704cd 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1609,6 +1609,10 @@ public class ConversationFragment extends XmppFragment .show(); return; } + final Account account = conversation.getAccount(); + if (account.setOption(Account.OPTION_SOFT_DISABLED, false)) { + activity.xmppConnectionService.updateAccount(account); + } final Contact contact = conversation.getContact(); if (RtpCapability.jmiSupport(contact)) { triggerRtpSession(contact.getAccount(), contact.getJid().asBareJid(), action);