diff options
author | Yana Stamcheva <yana@jitsi.org> | 2011-06-27 10:34:49 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2011-06-27 10:34:49 +0000 |
commit | 9bcbb52cdc44a76dfddafd8bd0216e29588fdaac (patch) | |
tree | fe6c3444915f4a6267203ccd075a013d4a69c81f /src/net/java/sip/communicator | |
parent | 87520e84a8645ba06beddd46daaacd0402f58e1d (diff) | |
download | jitsi-9bcbb52cdc44a76dfddafd8bd0216e29588fdaac.zip jitsi-9bcbb52cdc44a76dfddafd8bd0216e29588fdaac.tar.gz jitsi-9bcbb52cdc44a76dfddafd8bd0216e29588fdaac.tar.bz2 |
Disables Jingle support when calling is disabled.
Fixes NullPointerException, caused by loading non account properties, during account load.
Checks if the call still exists when a video property change is received in the gui.
Diffstat (limited to 'src/net/java/sip/communicator')
3 files changed, 68 insertions, 53 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPeerPanel.java b/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPeerPanel.java index 75c88f8..2b867ea 100644 --- a/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPeerPanel.java +++ b/src/net/java/sip/communicator/impl/gui/main/call/OneToOneCallPeerPanel.java @@ -533,26 +533,28 @@ public class OneToOneCallPeerPanel { Call call = callPeer.getCall(); - /* - * If the local video or desktop sharing is turned on, we - * ensure that the button is selected. - */ - if (CallManager.isDesktopSharingEnabled(call)) + if (call != null) { - callContainer.setDesktopSharingButtonSelected(true); - - if (CallManager.isRegionDesktopSharingEnabled(call)) + /* + * If the local video or desktop sharing is turned on, + * we ensure that the button is selected. + */ + if (CallManager.isDesktopSharingEnabled(call)) { - TransparentFrame frame - = DesktopSharingFrame.createTransparentFrame( - call, false); + callContainer.setDesktopSharingButtonSelected(true); + + if (CallManager.isRegionDesktopSharingEnabled(call)) + { + TransparentFrame frame = DesktopSharingFrame + .createTransparentFrame(call, false); - frame.setVisible(true); + frame.setVisible(true); + } + } + else if (CallManager.isLocalVideoEnabled(call)) + { + callContainer.setVideoButtonSelected(true); } - } - else if (CallManager.isLocalVideoEnabled(call)) - { - callContainer.setVideoButtonSelected(true); } } 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 f80757b..d6b155d 100644 --- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderServiceJabberImpl.java @@ -1310,6 +1310,8 @@ public class ProtocolProviderServiceJabberImpl OperationSetTelephonyConferencing.class, new OperationSetTelephonyConferencingJabberImpl(this)); + addJingleFeatures(); + // Check if desktop streaming is enabled. boolean isDesktopStreamingDisabled = JabberActivator.getConfigurationService() @@ -1337,46 +1339,12 @@ public class ProtocolProviderServiceJabberImpl addSupportedOperationSet( OperationSetDesktopSharingClient.class, new OperationSetDesktopSharingClientJabberImpl(this)); - } - } - - // Add Jingle features to supported features. - supportedFeatures.add(URN_XMPP_JINGLE); - supportedFeatures.add(URN_XMPP_JINGLE_RTP); - supportedFeatures.add(URN_XMPP_JINGLE_RAW_UDP_0); - - /* - * Reflect the preference of the user with respect to the use of - * ICE. - */ - if (accountID.getAccountPropertyBoolean( - ProtocolProviderFactory.IS_USE_ICE, - true)) - { - supportedFeatures.add(URN_XMPP_JINGLE_ICE_UDP_1); - } - supportedFeatures.add(URN_XMPP_JINGLE_RTP_AUDIO); - supportedFeatures.add(URN_XMPP_JINGLE_RTP_VIDEO); - supportedFeatures.add(URN_XMPP_JINGLE_RTP_ZRTP); - - /* - * Reflect the preference of the user with respect to the use of - * Jingle Nodes. - */ - if (accountID.getAccountPropertyBoolean( - ProtocolProviderFactoryJabberImpl.IS_USE_JINGLE_NODES, - true)) - { - supportedFeatures.add(URN_XMPP_JINGLE_NODES); + /* add extension to support remote control */ + supportedFeatures.add(InputEvtIQ.NAMESPACE); + } } - /* add extension to support remote control */ - supportedFeatures.add(InputEvtIQ.NAMESPACE); - - // XEP-0251: Jingle Session Transfer - supportedFeatures.add(URN_XMPP_JINGLE_TRANSFER_0); - // OperationSetContactCapabilities opsetContactCapabilities = new OperationSetContactCapabilitiesJabberImpl(this); @@ -1395,6 +1363,46 @@ public class ProtocolProviderServiceJabberImpl } /** + * Adds Jingle related features to the supported features. + */ + private void addJingleFeatures() + { + // Add Jingle features to supported features. + supportedFeatures.add(URN_XMPP_JINGLE); + supportedFeatures.add(URN_XMPP_JINGLE_RTP); + supportedFeatures.add(URN_XMPP_JINGLE_RAW_UDP_0); + + /* + * Reflect the preference of the user with respect to the use of + * ICE. + */ + if (accountID.getAccountPropertyBoolean( + ProtocolProviderFactory.IS_USE_ICE, + true)) + { + supportedFeatures.add(URN_XMPP_JINGLE_ICE_UDP_1); + } + + supportedFeatures.add(URN_XMPP_JINGLE_RTP_AUDIO); + supportedFeatures.add(URN_XMPP_JINGLE_RTP_VIDEO); + supportedFeatures.add(URN_XMPP_JINGLE_RTP_ZRTP); + + /* + * Reflect the preference of the user with respect to the use of + * Jingle Nodes. + */ + if (accountID.getAccountPropertyBoolean( + ProtocolProviderFactoryJabberImpl.IS_USE_JINGLE_NODES, + true)) + { + supportedFeatures.add(URN_XMPP_JINGLE_NODES); + } + + // XEP-0251: Jingle Session Transfer + supportedFeatures.add(URN_XMPP_JINGLE_TRANSFER_0); + } + + /** * Makes the service implementation close all open sockets and release * any resources that it might have taken and prepare for * shutdown/garbage collection. diff --git a/src/net/java/sip/communicator/service/protocol/AccountManager.java b/src/net/java/sip/communicator/service/protocol/AccountManager.java index ee5f0d1..ce34e82 100644 --- a/src/net/java/sip/communicator/service/protocol/AccountManager.java +++ b/src/net/java/sip/communicator/service/protocol/AccountManager.java @@ -127,6 +127,11 @@ public class AccountManager {
String storedAccount = storedAccountIter.next();
+ // If the property is not related to an account we skip it.
+ int dotIndex = storedAccount.lastIndexOf(".");
+ if (!storedAccount.substring(dotIndex + 1).startsWith("acc"))
+ continue;
+
if (logger.isDebugEnabled())
logger.debug("Loading account " + storedAccount);
|