diff options
author | paweldomas <pawel.domas@jitsi.org> | 2015-05-21 16:22:25 +0200 |
---|---|---|
committer | paweldomas <pawel.domas@jitsi.org> | 2015-05-21 16:22:25 +0200 |
commit | d09a39f8f453829f78dcea29d44b5abf604c14ee (patch) | |
tree | ca90a167786dcf95f7151d689b646adc847ad44e /src/net/java/sip/communicator/impl | |
parent | 821e53841bfed9d7e04819d372a7aa88fada2b12 (diff) | |
download | jitsi-d09a39f8f453829f78dcea29d44b5abf604c14ee.zip jitsi-d09a39f8f453829f78dcea29d44b5abf604c14ee.tar.gz jitsi-d09a39f8f453829f78dcea29d44b5abf604c14ee.tar.bz2 |
Converts "cache non caps" constant into field in ScServiceDiscoveryManager. Fixes "copy" method in IceTransportPacketExtension.
Diffstat (limited to 'src/net/java/sip/communicator/impl')
3 files changed, 16 insertions, 9 deletions
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 8b7e680..de0ae87 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -1370,7 +1370,8 @@ public class ProtocolProviderServiceJabberImpl new String[] { "http://jabber.org/protocol/commands"}, // Add features Jitsi supports in addition to smack. supportedFeatures.toArray( - new String[supportedFeatures.size()])); + new String[supportedFeatures.size()]), + true); /* * Expose the discoveryManager as service-public through the diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ScServiceDiscoveryManager.java b/src/net/java/sip/communicator/impl/protocol/jabber/ScServiceDiscoveryManager.java index d9761c6..46771ec 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ScServiceDiscoveryManager.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ScServiceDiscoveryManager.java @@ -42,10 +42,10 @@ public class ScServiceDiscoveryManager /** * The flag which indicates whether we are currently storing non-caps. */ - private static final boolean CACHE_NON_CAPS = true; + private final boolean cacheNonCaps; /** - * The cache of non-caps. Used only if {@link #CACHE_NON_CAPS} is + * The cache of non-caps. Used only if {@link #cacheNonCaps} is * <tt>true</tt>. */ private final Map<String, DiscoverInfo> nonCapsCache @@ -113,12 +113,15 @@ public class ScServiceDiscoveryManager * features to be added to the new instance and to the * <tt>ServiceDiscoveryManager</tt> of the specified <tt>connection</tt> * which is to be wrapped by the new instance + * @param cacheNonCaps <tt>true</tt> if we want to cache entity features + * even though it does not support XEP-0115 */ public ScServiceDiscoveryManager( ProtocolProviderService parentProvider, XMPPConnection connection, String[] featuresToRemove, - String[] featuresToAdd) + String[] featuresToAdd, + boolean cacheNonCaps) { this.parentProvider = parentProvider; this.connection = connection; @@ -130,6 +133,8 @@ public class ScServiceDiscoveryManager this.unmodifiableFeatures = Collections.unmodifiableList(this.features); this.identities = new ArrayList<DiscoverInfo.Identity>(); + this.cacheNonCaps = cacheNonCaps; + DiscoverInfo.Identity identity = new DiscoverInfo.Identity( "client", @@ -484,7 +489,7 @@ public class ScServiceDiscoveryManager EntityCapsManager.Caps caps = capsManager.getCapsByUser(entityID); // if caps is not valid, has empty hash - if (CACHE_NON_CAPS && (caps == null || !caps.isValid(discoverInfo))) + if (cacheNonCaps && (caps == null || !caps.isValid(discoverInfo))) { discoverInfo = nonCapsCache.get(entityID); if (discoverInfo != null) @@ -509,7 +514,7 @@ public class ScServiceDiscoveryManager if (caps == null) { - if (CACHE_NON_CAPS) + if (cacheNonCaps) nonCapsCache.put(entityID, discoverInfo); } else @@ -536,7 +541,7 @@ public class ScServiceDiscoveryManager EntityCapsManager.Caps caps = capsManager.getCapsByUser(entityID); // if caps is not valid, has empty hash - if (CACHE_NON_CAPS && (caps == null || !caps.isValid(discoverInfo))) + if (cacheNonCaps && (caps == null || !caps.isValid(discoverInfo))) { discoverInfo = nonCapsCache.get(entityID); if (discoverInfo != null) @@ -756,11 +761,11 @@ public class ScServiceDiscoveryManager caps = null; } - boolean fireEvent; + boolean fireEvent = false; if (caps == null) { - if (CACHE_NON_CAPS) + if (cacheNonCaps) { nonCapsCache.put(entityID, discoverInfo); fireEvent = true; diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/jingle/IceUdpTransportPacketExtension.java b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/jingle/IceUdpTransportPacketExtension.java index 4282b87..4e0bd8d 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/extensions/jingle/IceUdpTransportPacketExtension.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/extensions/jingle/IceUdpTransportPacketExtension.java @@ -315,6 +315,7 @@ public class IceUdpTransportPacketExtension copy.setFingerprint(dtlsFingerprint.getFingerprint()); copy.setHash(dtlsFingerprint.getHash()); copy.setRequired(dtlsFingerprint.getRequired()); + copy.setSetup(dtlsFingerprint.getSetup()); dst.addChildExtension(copy); } |