From 478a8ec46cc6c3ccebaadf965f9baa14e5975d1d Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Fri, 13 Feb 2015 15:28:48 +0200 Subject: [PATCH 1/2] Removes the "google ICE" option from the GUI, and some Gtalk-related code. --- .../OperationSetBasicTelephonyJabberImpl.java | 41 ------------------- ...ationSetContactCapabilitiesJabberImpl.java | 7 ++++ .../ProtocolProviderServiceJabberImpl.java | 30 ++------------ .../jabberaccregwizz/IceConfigPanel.java | 29 ------------- .../JabberAccountRegistrationForm.java | 3 -- .../protocol/ProtocolProviderFactory.java | 5 --- .../protocol/jabber/JabberAccountID.java | 22 ---------- 7 files changed, 11 insertions(+), 126 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java index da4fbfe25..d462ba016 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java @@ -475,8 +475,6 @@ private String discoverFullJid( String calleeAddress, String fullCalleeURI = null; DiscoverInfo discoverInfo = null; int bestPriority = -1; - boolean isGingle = false; - String gingleURI = null; PresenceStatus jabberStatus = null; String calleeURI = null; @@ -505,11 +503,6 @@ private String discoverFullJid( String calleeAddress, logger.warn("could not retrieve info for " + fullCalleeURI, ex); } - boolean hasGtalkCaps = - getProtocolProvider().isExtFeatureListSupported( - calleeURI, ProtocolProviderServiceJabberImpl. - CAPS_GTALK_WEB_VOICE); - if (discoverInfo != null && discoverInfo.containsFeature( ProtocolProviderServiceJabberImpl.URN_XMPP_JINGLE)) { @@ -517,7 +510,6 @@ private String discoverFullJid( String calleeAddress, { bestPriority = priority; fullCalleeURI = calleeURI; - isGingle = false; jabberStatus = OperationSetPersistentPresenceJabberImpl .jabberStatusToPresenceStatus( presence, protocolProvider); @@ -531,45 +523,12 @@ else if(priority == bestPriority && jabberStatus != null) if(tempStatus.compareTo(jabberStatus) > 0) { fullCalleeURI = calleeURI; - isGingle = false; jabberStatus = tempStatus; } } } - else if (protocolProvider.isGTalkTesting() // GTalk enabled locally - // see if peer supports Google Talk voice - && (hasGtalkCaps || isAlwaysCallGtalk)) - { - if(priority > bestPriority) - { - bestPriority = priority; - isGingle = true; - gingleURI = calleeURI; - jabberStatus =OperationSetPersistentPresenceJabberImpl - .jabberStatusToPresenceStatus( presence, - protocolProvider); - } - else if(priority == bestPriority && jabberStatus != null) - { - PresenceStatus tempStatus = - OperationSetPersistentPresenceJabberImpl - .jabberStatusToPresenceStatus( - presence, protocolProvider); - if(tempStatus.compareTo(jabberStatus) > 0) - { - isGingle = true; - gingleURI = calleeURI; - jabberStatus =OperationSetPersistentPresenceJabberImpl - .jabberStatusToPresenceStatus( - presence, protocolProvider); - } - } - } } - if(isGingle) - fullCalleeURI = gingleURI; - if(logger.isInfoEnabled()) logger.info("Full JID for outgoing call: " + fullCalleeURI + ", priority " + bestPriority); diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetContactCapabilitiesJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetContactCapabilitiesJabberImpl.java index 9afaee5b2..ddb187f0d 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetContactCapabilitiesJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetContactCapabilitiesJabberImpl.java @@ -353,6 +353,12 @@ private U getOperationSet(String jid, jid, features))) { + // XXX(boris): since Gtalk is not supported anymore, the + // features in OPERATION_SETS_TO_FEATURES needed to be supported + // cannot be overridden by capabilities. + opset = null; + + /* if(CAPS_OPERATION_SETS_TO_FEATURES.containsKey(opsetClass)) { String[] extFeatures @@ -377,6 +383,7 @@ else if((extFeatures == null) { opset = null; } + */ } } diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java index ef4eb6fdb..7a5c49d38 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -1426,19 +1426,15 @@ private void registerServiceDiscoveryManager() if (accountID != null && accountID.getAccountPropertyBoolean( ProtocolProviderFactory.IS_CALLING_DISABLED_FOR_ACCOUNT, false)) - isCallingDisabled = true; + isCallingDisabledForAccount = true; - if(isGTalkTesting() - && !isCallingDisabled - && !isCallingDisabledForAccount) + if(!isCallingDisabled && !isCallingDisabledForAccount) { - // Add Google Talk "ext" capabilities + // XXX(boris): do we still need to advertise these, now that we do + // not support Gtalk? discoveryManager.addExtFeature(CAPS_GTALK_WEB_VOICE); discoveryManager.addExtFeature(CAPS_GTALK_WEB_VIDEO); discoveryManager.addExtFeature(CAPS_GTALK_WEB_CAMERA); - discoveryManager.addFeature(URN_GOOGLE_VOICE); - discoveryManager.addFeature(URN_GOOGLE_VIDEO); - discoveryManager.addFeature(URN_GOOGLE_CAMERA); } /* @@ -2799,24 +2795,6 @@ public SecurityAuthority getAuthority() return authority; } - /** - * Returns true if gtalktesting is enabled, false otherwise. - * - * @return true if gtalktesting is enabled, false otherwise. - */ - public boolean isGTalkTesting() - { - return - Boolean.getBoolean("gtalktesting") - || JabberActivator.getConfigurationService().getBoolean( - "net.java.sip.communicator.impl.protocol.jabber" - + ".gtalktesting", - false) - || accountID.getAccountPropertyBoolean( - ProtocolProviderFactory.IS_USE_GOOGLE_ICE, - true); - } - UserCredentials getUserCredentials() { return userCredentials; diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/IceConfigPanel.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/IceConfigPanel.java index a7a96c94a..3bc427d4f 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/IceConfigPanel.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/IceConfigPanel.java @@ -39,12 +39,6 @@ public class IceConfigPanel private final JCheckBox iceBox = new SIPCommCheckBox( Resources.getString("plugin.jabberaccregwizz.USE_ICE")); - /** - * The check box allowing the user to choose to use ICE. - */ - private final JCheckBox googleIceBox = new SIPCommCheckBox( - Resources.getString("plugin.jabberaccregwizz.USE_GOOGLE_ICE")); - /** * The check box allowing the user to choose to automatically discover * STUN servers. @@ -110,7 +104,6 @@ public IceConfigPanel() this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); iceBox.setAlignmentX(Component.LEFT_ALIGNMENT); - googleIceBox.setAlignmentX(Component.LEFT_ALIGNMENT); autoDiscoverBox.setAlignmentX(Component.LEFT_ALIGNMENT); defaultStunBox.setAlignmentX(Component.LEFT_ALIGNMENT); @@ -122,7 +115,6 @@ public IceConfigPanel() autoDiscoverBox.setSelected(true); defaultStunBox.setSelected(true); - googleIceBox.setSelected(true); jnBox.setSelected(true); jnAutoDiscoverBox.setSelected(true); @@ -131,7 +123,6 @@ public IceConfigPanel() JPanel checkBoxPanel = new TransparentPanel(new GridLayout(0, 1)); checkBoxPanel.add(iceBox); - checkBoxPanel.add(googleIceBox); checkBoxPanel.add(upnpBox); checkBoxPanel.add(autoDiscoverBox); checkBoxPanel.add(defaultStunBox); @@ -763,26 +754,6 @@ protected void setUseIce(boolean isUseIce) iceBox.setSelected(isUseIce); } - /** - * Indicates if ice should be used for this account. - * @return true if Google ICE should be used for this account, - * otherwise returns false - */ - protected boolean isUseGoogleIce() - { - return googleIceBox.isSelected(); - } - - /** - * Sets the useGoogleIce property. - * @param isUseIce true to indicate that Google ICE should be used - * for this account, false - otherwise. - */ - protected void setUseGoogleIce(boolean isUseIce) - { - googleIceBox.setSelected(isUseIce); - } - /** * Indicates if the stun server should be automatically discovered. * @return true if the stun server should be automatically diff --git a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationForm.java b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationForm.java index f22daeb02..0bea396ee 100644 --- a/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationForm.java +++ b/src/net/java/sip/communicator/plugin/jabberaccregwizz/JabberAccountRegistrationForm.java @@ -322,7 +322,6 @@ public boolean commitPage(JabberAccountRegistration registration) securityPanel.commitPanel(registration.getSecurityRegistration()); registration.setUseIce(iceConfigPanel.isUseIce()); - registration.setUseGoogleIce(iceConfigPanel.isUseGoogleIce()); registration.setAutoDiscoverStun(iceConfigPanel.isAutoDiscoverStun()); registration.setUseDefaultStunServer( iceConfigPanel.isUseDefaultStunServer()); @@ -417,8 +416,6 @@ public void loadAccount(JabberAccountRegistration accountReg) iceConfigPanel.setUseIce(accountReg.isUseIce()); - iceConfigPanel.setUseGoogleIce(accountReg.isUseGoogleIce()); - iceConfigPanel.setAutoDiscoverStun(accountReg.isAutoDiscoverStun()); iceConfigPanel.setUseDefaultStunServer( diff --git a/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java b/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java index e70e8a061..6ec30b846 100644 --- a/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java +++ b/src/net/java/sip/communicator/service/protocol/ProtocolProviderFactory.java @@ -338,11 +338,6 @@ public abstract class ProtocolProviderFactory */ public static final String IS_USE_ICE = "ICE_ENABLED"; - /** - * Indicates if Google ICE should be used. - */ - public static final String IS_USE_GOOGLE_ICE = "GTALK_ICE_ENABLED"; - /** * Indicates if STUN server should be automatically discovered. */ diff --git a/src/net/java/sip/communicator/service/protocol/jabber/JabberAccountID.java b/src/net/java/sip/communicator/service/protocol/jabber/JabberAccountID.java index d2ccfd793..e965603f9 100644 --- a/src/net/java/sip/communicator/service/protocol/jabber/JabberAccountID.java +++ b/src/net/java/sip/communicator/service/protocol/jabber/JabberAccountID.java @@ -350,28 +350,6 @@ public void setUseIce(boolean isUseIce) putAccountProperty(ProtocolProviderFactory.IS_USE_ICE, isUseIce); } - /** - * Indicates if ice should be used for this account. - * @return true if ICE should be used for this account, otherwise - * returns false - */ - public boolean isUseGoogleIce() - { - return getAccountPropertyBoolean( - ProtocolProviderFactory.IS_USE_GOOGLE_ICE, true); - } - - /** - * Sets the useGoogleIce property. - * @param isUseIce true to indicate that ICE should be used for - * this account, false - otherwise. - */ - public void setUseGoogleIce(boolean isUseIce) - { - putAccountProperty( - ProtocolProviderFactory.IS_USE_GOOGLE_ICE, isUseIce); - } - /** * Indicates if the stun server should be automatically discovered. * @return true if the stun server should be automatically From 4e5c881b236ec4be89199c06674b0dfa186d0513 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Fri, 13 Feb 2015 16:18:54 +0200 Subject: [PATCH 2/2] Removes XMPP capability code which was only used for google jingle. --- .../OperationSetBasicTelephonyJabberImpl.java | 9 +- ...ationSetContactCapabilitiesJabberImpl.java | 55 --------- .../ProtocolProviderServiceJabberImpl.java | 110 ------------------ 3 files changed, 4 insertions(+), 170 deletions(-) diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java index d462ba016..70c6a494f 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetBasicTelephonyJabberImpl.java @@ -12,6 +12,7 @@ import net.java.sip.communicator.impl.protocol.jabber.extensions.jingle.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.service.protocol.event.*; +import net.java.sip.communicator.service.protocol.jabber.*; import net.java.sip.communicator.service.protocol.media.*; import net.java.sip.communicator.util.*; @@ -344,7 +345,7 @@ else if(calleeAddress.endsWith(GOOGLE_VOICE_DOMAIN)) } String bypassDomain = accountID.getAccountPropertyString( - "TELEPHONY_BYPASS_GTALK_CAPS"); + JabberAccountID.TELEPHONY_BYPASS_GTALK_CAPS); boolean alwaysCallGtalk = ((bypassDomain != null) @@ -373,7 +374,7 @@ else if(calleeAddress.endsWith(GOOGLE_VOICE_DOMAIN)) // connected one with highest priority. if (fullCalleeURI == null) fullCalleeURI = - discoverFullJid(calleeAddress, alwaysCallGtalk); + discoverFullJid(calleeAddress); if (fullCalleeURI == null) throw new OperationFailedException( @@ -465,12 +466,10 @@ else if(calleeAddress.endsWith(GOOGLE_VOICE_DOMAIN)) * priority which supports either Jingle or Gtalk. Returns the full JID. * * @param calleeAddress the address of the callee - * @param isAlwaysCallGtalk indicates if gtalk should be called * * @return the full callee URI */ - private String discoverFullJid( String calleeAddress, - boolean isAlwaysCallGtalk) + private String discoverFullJid(String calleeAddress) { String fullCalleeURI = null; DiscoverInfo discoverInfo = null; diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetContactCapabilitiesJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetContactCapabilitiesJabberImpl.java index ddb187f0d..8be1ebc72 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetContactCapabilitiesJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/OperationSetContactCapabilitiesJabberImpl.java @@ -58,16 +58,6 @@ public class OperationSetContactCapabilitiesJabberImpl OPERATION_SETS_TO_FEATURES = new HashMap, String[]>(); - /** - * The Map which associates specific additional - * OperationSet class with the capabilities to be supported by a - * Contact in order to consider the Contact to possess the - * respective OperationSet capability. - */ - private static final Map, String[]> - CAPS_OPERATION_SETS_TO_FEATURES - = new HashMap, String[]>(); - static { OFFLINE_OPERATION_SETS.add(OperationSetBasicInstantMessaging.class); @@ -107,21 +97,6 @@ public class OperationSetContactCapabilitiesJabberImpl { MessageCorrectionExtension.NAMESPACE }); - - CAPS_OPERATION_SETS_TO_FEATURES.put( - OperationSetBasicTelephony.class, - new String[] - { - ProtocolProviderServiceJabberImpl.CAPS_GTALK_WEB_VOICE, - }); - - CAPS_OPERATION_SETS_TO_FEATURES.put( - OperationSetVideoTelephony.class, - new String[] - { - ProtocolProviderServiceJabberImpl.CAPS_GTALK_WEB_VOICE, - ProtocolProviderServiceJabberImpl.CAPS_GTALK_WEB_VIDEO - }); } /** @@ -353,37 +328,7 @@ private U getOperationSet(String jid, jid, features))) { - // XXX(boris): since Gtalk is not supported anymore, the - // features in OPERATION_SETS_TO_FEATURES needed to be supported - // cannot be overridden by capabilities. opset = null; - - /* - if(CAPS_OPERATION_SETS_TO_FEATURES.containsKey(opsetClass)) - { - String[] extFeatures - = CAPS_OPERATION_SETS_TO_FEATURES.get(opsetClass); - - // test GTalk - if (!parentProvider.isGTalkTesting()) - { - opset = null; - } - else if((extFeatures == null) - || ((extFeatures.length != 0) - && !parentProvider - .isExtFeatureListSupported( - jid, - extFeatures))) - { - opset = null; - } - } - else - { - opset = null; - } - */ } } diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java index 7a5c49d38..3d6587095 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -17,7 +17,6 @@ import net.java.sip.communicator.impl.protocol.jabber.debugger.*; import net.java.sip.communicator.impl.protocol.jabber.extensions.*; -import net.java.sip.communicator.impl.protocol.jabber.extensions.caps.*; import net.java.sip.communicator.impl.protocol.jabber.extensions.carbon.*; import net.java.sip.communicator.impl.protocol.jabber.extensions.coin.*; import net.java.sip.communicator.impl.protocol.jabber.extensions.colibri.*; @@ -148,41 +147,6 @@ public class ProtocolProviderServiceJabberImpl public static final String URN_XMPP_JINGLE_RTP_HDREXT = "urn:xmpp:jingle:apps:rtp:rtp-hdrext:0"; - /** - * Capabilities name for audio call in Google Talk web version. - */ - public static final String CAPS_GTALK_WEB_VOICE = "voice-v1"; - - /** - * Capabilities name for video call (receive side) in Google Talk web - * version. - */ - public static final String CAPS_GTALK_WEB_VIDEO = "video-v1"; - - /** - * Capabilities name for video call (sender side) in Google Talk web - * version. - */ - public static final String CAPS_GTALK_WEB_CAMERA = "camera-v1"; - - /** - * URN for Google voice. - */ - public static final String URN_GOOGLE_VOICE = - "http://www.google.com/xmpp/protocol/voice/v1"; - - /** - * URN for Google camera. - */ - public static final String URN_GOOGLE_CAMERA = - "http://www.google.com/xmpp/protocol/camera/v1"; - - /** - * URN for Google video. - */ - public static final String URN_GOOGLE_VIDEO = - "http://www.google.com/xmpp/protocol/video/v1"; - /** * URN for XEP-0077 inband registration */ @@ -1418,25 +1382,6 @@ private void registerServiceDiscoveryManager() supportedFeatures.toArray( new String[supportedFeatures.size()])); - boolean isCallingDisabled - = JabberActivator.getConfigurationService() - .getBoolean(IS_CALLING_DISABLED, false); - - boolean isCallingDisabledForAccount = false; - if (accountID != null && accountID.getAccountPropertyBoolean( - ProtocolProviderFactory.IS_CALLING_DISABLED_FOR_ACCOUNT, - false)) - isCallingDisabledForAccount = true; - - if(!isCallingDisabled && !isCallingDisabledForAccount) - { - // XXX(boris): do we still need to advertise these, now that we do - // not support Gtalk? - discoveryManager.addExtFeature(CAPS_GTALK_WEB_VOICE); - discoveryManager.addExtFeature(CAPS_GTALK_WEB_VIDEO); - discoveryManager.addExtFeature(CAPS_GTALK_WEB_CAMERA); - } - /* * Expose the discoveryManager as service-public through the * OperationSetContactCapabilities of this ProtocolProviderService. @@ -2369,61 +2314,6 @@ JabberStatusEnum getJabberStatusEnum() return jabberStatusEnum; } - /** - * Determines if the given list of ext features is supported by the - * specified jabber id. - * - * @param jid the jabber id for which to check - * @param extFeatures the list of ext features to check for - * - * @return true if the list of ext features is supported; - * otherwise, false - */ - public boolean isExtFeatureListSupported(String jid, String... extFeatures) - { - EntityCapsManager capsManager = discoveryManager.getCapsManager(); - EntityCapsManager.Caps caps = capsManager.getCapsByUser(jid); - - String bypassDomain = accountID.getAccountPropertyString( - "TELEPHONY_BYPASS_GTALK_CAPS"); - String domain = StringUtils.parseServer(jid); - boolean domainEquals = domain.equals(bypassDomain); - - if(caps != null && caps.ext != null) - { - String exts[] = caps.ext.split(" "); - boolean found = false; - - for(String extFeature : extFeatures) - { - // in case we have a domain that have to bypass GTalk caps - if(extFeature.equals(CAPS_GTALK_WEB_VOICE) && domainEquals) - { - return true; - } - - found = false; - for(String ext : exts) - { - if(ext.equals(extFeature)) - { - found = true; - break; - } - } - - if(!found) - { - break; - } - } - - return found; - } - - return false; - } - /** * Determines if the given list of features is supported by the * specified jabber id.