diff options
8 files changed, 15 insertions, 39 deletions
diff --git a/src/net/java/sip/communicator/impl/globaldisplaydetails/GlobalStatusServiceImpl.java b/src/net/java/sip/communicator/impl/globaldisplaydetails/GlobalStatusServiceImpl.java index eb2596d..7ee00ad 100644 --- a/src/net/java/sip/communicator/impl/globaldisplaydetails/GlobalStatusServiceImpl.java +++ b/src/net/java/sip/communicator/impl/globaldisplaydetails/GlobalStatusServiceImpl.java @@ -261,12 +261,11 @@ public class GlobalStatusServiceImpl * * @param protocolProvider the protocol provider to which we * change the status. - * @param status the status tu publish. + * @param status the status to publish. */ public void publishStatus( ProtocolProviderService protocolProvider, - PresenceStatus status, - boolean rememberStatus) + PresenceStatus status) { OperationSetPresence presence = protocolProvider.getOperationSet(OperationSetPresence.class); @@ -309,10 +308,9 @@ public class GlobalStatusServiceImpl LoginManager.logoff(protocolProvider); } - if(rememberStatus) - saveStatusInformation( - protocolProvider, - status.getStatusName()); + saveStatusInformation( + protocolProvider, + status.getStatusName()); } /** diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusMenu.java b/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusMenu.java index 5c96828..cc17616 100644 --- a/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/presence/PresenceStatusMenu.java @@ -165,7 +165,7 @@ public class PresenceStatusMenu if (status.getStatusName().equals(menuItemText)) { GuiActivator.getGlobalStatusService() - .publishStatus(protocolProvider, status, true); + .publishStatus(protocolProvider, status); setSelectedStatus(status); @@ -184,9 +184,6 @@ public class PresenceStatusMenu */ public void updateStatus(PresenceStatus presenceStatus) { - OperationSetPresence presence - = AccountStatusUtils.getProtocolPresenceOpSet(protocolProvider); - if (logger.isTraceEnabled()) logger.trace("Update status for provider: " + protocolProvider.getAccountID().getAccountAddress() @@ -194,13 +191,6 @@ public class PresenceStatusMenu this.setSelectedStatus(presenceStatus); - if (protocolProvider.isRegistered() - && !presence.getPresenceStatus().equals(presenceStatus)) - { - GuiActivator.getGlobalStatusService() - .publishStatus(protocolProvider, presenceStatus, false); - } - for(int i =0; i < getItemCount(); i++) { JMenuItem item = getItem(i); diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/ReadonlyStatusItem.java b/src/net/java/sip/communicator/impl/gui/main/presence/ReadonlyStatusItem.java index cd40ee4..b899af3 100644 --- a/src/net/java/sip/communicator/impl/gui/main/presence/ReadonlyStatusItem.java +++ b/src/net/java/sip/communicator/impl/gui/main/presence/ReadonlyStatusItem.java @@ -280,21 +280,11 @@ public class ReadonlyStatusItem */ public void updateStatus(PresenceStatus presenceStatus) { - OperationSetPresence presence - = AccountStatusUtils.getProtocolPresenceOpSet(protocolProvider); - if (logger.isTraceEnabled()) logger.trace("Update status for provider: " + protocolProvider.getAccountID().getAccountAddress() + ". The new status will be: " + presenceStatus.getStatusName()); this.setSelectedStatus(presenceStatus); - - if (protocolProvider.isRegistered() - && !presence.getPresenceStatus().equals(presenceStatus)) - { - GuiActivator.getGlobalStatusService() - .publishStatus(protocolProvider, presenceStatus, false); - } } } diff --git a/src/net/java/sip/communicator/impl/gui/main/presence/SimpleStatusMenu.java b/src/net/java/sip/communicator/impl/gui/main/presence/SimpleStatusMenu.java index b6aaf60..a230812 100644 --- a/src/net/java/sip/communicator/impl/gui/main/presence/SimpleStatusMenu.java +++ b/src/net/java/sip/communicator/impl/gui/main/presence/SimpleStatusMenu.java @@ -133,12 +133,12 @@ public class SimpleStatusMenu if (itemName.equals(GlobalStatusEnum.ONLINE_STATUS)) { GuiActivator.getGlobalStatusService() - .publishStatus(protocolProvider, GlobalStatusEnum.ONLINE, true); + .publishStatus(protocolProvider, GlobalStatusEnum.ONLINE); } else { GuiActivator.getGlobalStatusService() - .publishStatus(protocolProvider, GlobalStatusEnum.OFFLINE, true); + .publishStatus(protocolProvider, GlobalStatusEnum.OFFLINE); } } diff --git a/src/net/java/sip/communicator/impl/osdependent/jdic/StatusSelector.java b/src/net/java/sip/communicator/impl/osdependent/jdic/StatusSelector.java index 0e3625f..ae469a4 100644 --- a/src/net/java/sip/communicator/impl/osdependent/jdic/StatusSelector.java +++ b/src/net/java/sip/communicator/impl/osdependent/jdic/StatusSelector.java @@ -168,7 +168,7 @@ public class StatusSelector if (status.getStatusName().equals(statusName)) { OsDependentActivator.getGlobalStatusService() - .publishStatus(provider, status, true); + .publishStatus(provider, status); break; } diff --git a/src/net/java/sip/communicator/impl/osdependent/jdic/StatusSimpleSelector.java b/src/net/java/sip/communicator/impl/osdependent/jdic/StatusSimpleSelector.java index ec0c100..0be1836 100644 --- a/src/net/java/sip/communicator/impl/osdependent/jdic/StatusSimpleSelector.java +++ b/src/net/java/sip/communicator/impl/osdependent/jdic/StatusSimpleSelector.java @@ -107,12 +107,12 @@ public class StatusSimpleSelector if(itemName.equals("online")) { OsDependentActivator.getGlobalStatusService() - .publishStatus(provider, GlobalStatusEnum.ONLINE, true); + .publishStatus(provider, GlobalStatusEnum.ONLINE); } else { OsDependentActivator.getGlobalStatusService() - .publishStatus(provider, GlobalStatusEnum.OFFLINE, true); + .publishStatus(provider, GlobalStatusEnum.OFFLINE); } } diff --git a/src/net/java/sip/communicator/plugin/generalconfig/autoaway/AutoAwayWatcher.java b/src/net/java/sip/communicator/plugin/generalconfig/autoaway/AutoAwayWatcher.java index 80980a9..ba5129e 100644 --- a/src/net/java/sip/communicator/plugin/generalconfig/autoaway/AutoAwayWatcher.java +++ b/src/net/java/sip/communicator/plugin/generalconfig/autoaway/AutoAwayWatcher.java @@ -237,15 +237,15 @@ public class AutoAwayWatcher continue;
}
- addProviderToLastStates(protocolProvider, status);
-
PresenceStatus newStatus
= StatusUpdateThread.findAwayStatus(presence);
try
{
- if (newStatus != null)
+ if (newStatus != null && !status.equals(newStatus))
{
+ addProviderToLastStates(protocolProvider, status);
+
presence.publishPresenceStatus(
newStatus,
newStatus.getStatusName());
diff --git a/src/net/java/sip/communicator/service/protocol/globalstatus/GlobalStatusService.java b/src/net/java/sip/communicator/service/protocol/globalstatus/GlobalStatusService.java index 93840c4..c3c369a 100644 --- a/src/net/java/sip/communicator/service/protocol/globalstatus/GlobalStatusService.java +++ b/src/net/java/sip/communicator/service/protocol/globalstatus/GlobalStatusService.java @@ -57,10 +57,8 @@ public interface GlobalStatusService * @param protocolProvider the protocol provider to which we * change the status. * @param status the status to publish. - * @param rememberStatus whether to remember the status for future restore. */ public void publishStatus( ProtocolProviderService protocolProvider, - PresenceStatus status, - boolean rememberStatus); + PresenceStatus status); } |