From 7be70744f53b5a8f5b6388c9f14c34730f22a7f6 Mon Sep 17 00:00:00 2001 From: Ingo Bauersachs Date: Tue, 28 Feb 2017 08:22:25 +0100 Subject: Fix Voicemail URI editing in UI Closes #333 --- .../protocol/sip/SIPAccountRegistration.java | 38 +++++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/src/net/java/sip/communicator/service/protocol/sip/SIPAccountRegistration.java b/src/net/java/sip/communicator/service/protocol/sip/SIPAccountRegistration.java index 9719b8c..5355855 100644 --- a/src/net/java/sip/communicator/service/protocol/sip/SIPAccountRegistration.java +++ b/src/net/java/sip/communicator/service/protocol/sip/SIPAccountRegistration.java @@ -24,7 +24,7 @@ import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.util.*; import org.jitsi.service.neomedia.*; - +import org.jitsi.util.StringUtils; import org.osgi.framework.*; /** @@ -257,23 +257,37 @@ public class SIPAccountRegistration encodingsRegistration.storeProperties(this.accountProperties); - if (isModification) + if(isMessageWaitingIndicationsEnabled()) { - if (isMessageWaitingIndicationsEnabled()) + if(!StringUtils.isNullOrEmpty(getVoicemailURI(), true)) + accountProperties.put( + ProtocolProviderFactory.VOICEMAIL_URI, + getVoicemailURI()); + else if(isModification) + accountProperties.put(ProtocolProviderFactory.VOICEMAIL_URI, ""); + + if(!StringUtils.isNullOrEmpty( + getVoicemailCheckURI(), true)) + accountProperties.put( + ProtocolProviderFactory.VOICEMAIL_CHECK_URI, + getVoicemailCheckURI()); + else if(isModification) + accountProperties.put( + ProtocolProviderFactory.VOICEMAIL_CHECK_URI, ""); + + if(isModification) { - setVoicemailURI(""); - setVoicemailCheckURI(""); // remove the property as true is by default, // and null removes property - removeAccountProperty( - ProtocolProviderFactory.VOICEMAIL_ENABLED); - } else - { - accountProperties.put( - ProtocolProviderFactory.VOICEMAIL_ENABLED, - Boolean.FALSE.toString()); + accountProperties.put(ProtocolProviderFactory.VOICEMAIL_ENABLED, + null); } } + else if(isModification) + { + accountProperties.put(ProtocolProviderFactory.VOICEMAIL_ENABLED, + Boolean.FALSE.toString()); + } super.storeProperties( protocolIconPath, accountIconPath, accountProperties); -- cgit v1.1