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.
cusax-fix
Yana Stamcheva 15 years ago
parent 87520e84a8
commit 9bcbb52cdc

@ -533,26 +533,28 @@ else if (event.getNewValue().equals(MediaDirection.SENDRECV))
{
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);
}
}

@ -1310,6 +1310,8 @@ protected void initialize(String screenname,
OperationSetTelephonyConferencing.class,
new OperationSetTelephonyConferencingJabberImpl(this));
addJingleFeatures();
// Check if desktop streaming is enabled.
boolean isDesktopStreamingDisabled
= JabberActivator.getConfigurationService()
@ -1337,46 +1339,12 @@ protected void initialize(String screenname,
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);
@ -1394,6 +1362,46 @@ protected void initialize(String screenname,
}
}
/**
* 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

@ -127,6 +127,11 @@ private void doLoadStoredAccounts(ProtocolProviderFactory factory)
{
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);

Loading…
Cancel
Save