|
|
|
|
@ -59,12 +59,6 @@ public class StatusSubMenu
|
|
|
|
|
*/
|
|
|
|
|
private static boolean hideAccountStatusSelectors = false;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Ignore protocols that don't have presence operation sets
|
|
|
|
|
* when looking for global status.
|
|
|
|
|
*/
|
|
|
|
|
private static boolean ignoreNonPresenceOpSetProtocols = false;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates an instance of <tt>StatusSubMenu</tt>.
|
|
|
|
|
*
|
|
|
|
|
@ -113,13 +107,6 @@ public StatusSubMenu(SystrayServiceJdicImpl tray, boolean swing)
|
|
|
|
|
hideAccountStatusSelectors);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String ignoreStrValue
|
|
|
|
|
= OsDependentActivator.getResources().getSettingsString(
|
|
|
|
|
"net.java.sip.communicator.service.protocol.globalstatus" +
|
|
|
|
|
".IGNORE_NONPRESENCEOPSET_PROTOCOLS");
|
|
|
|
|
if(ignoreStrValue != null)
|
|
|
|
|
ignoreNonPresenceOpSetProtocols = Boolean.valueOf(ignoreStrValue);
|
|
|
|
|
|
|
|
|
|
PresenceStatus offlineStatus = null;
|
|
|
|
|
// creates menu item entry for every global status
|
|
|
|
|
for(GlobalStatusEnum status : GlobalStatusEnum.globalStatusSet)
|
|
|
|
|
@ -389,6 +376,7 @@ public void registrationStateChanged(RegistrationStateChangeEvent evt)
|
|
|
|
|
private void updateGlobalStatus()
|
|
|
|
|
{
|
|
|
|
|
int status = 0;
|
|
|
|
|
boolean hasAvailableProvider = false;
|
|
|
|
|
|
|
|
|
|
for(ProtocolProviderService protocolProvider : getProtocolProviders())
|
|
|
|
|
{
|
|
|
|
|
@ -407,8 +395,11 @@ private void updateGlobalStatus()
|
|
|
|
|
OperationSetPresence presence
|
|
|
|
|
= protocolProvider.getOperationSet(OperationSetPresence.class);
|
|
|
|
|
|
|
|
|
|
if(presence == null && ignoreNonPresenceOpSetProtocols)
|
|
|
|
|
if(presence == null)
|
|
|
|
|
{
|
|
|
|
|
hasAvailableProvider = true;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int presenceStatus
|
|
|
|
|
= (presence == null)
|
|
|
|
|
@ -419,6 +410,10 @@ private void updateGlobalStatus()
|
|
|
|
|
status = presenceStatus;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if we have at least one online provider
|
|
|
|
|
if(status == 0 && hasAvailableProvider)
|
|
|
|
|
status = PresenceStatus.AVAILABLE_THRESHOLD;
|
|
|
|
|
|
|
|
|
|
selectItemFromStatus(status);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|