diff options
author | Danny van Heumen <danny@dannyvanheumen.nl> | 2015-02-13 23:58:11 +0100 |
---|---|---|
committer | Danny van Heumen <danny@dannyvanheumen.nl> | 2015-03-13 19:35:55 +0100 |
commit | 23818044bd4385d8a7f8e4f38b2514a6d71d81d6 (patch) | |
tree | cc96803929620e6bfcb4f0277870757cea3f31a1 /src/net/java | |
parent | 147f39494331c074e11b3ee24e9aac921f7ca869 (diff) | |
download | jitsi-23818044bd4385d8a7f8e4f38b2514a6d71d81d6.zip jitsi-23818044bd4385d8a7f8e4f38b2514a6d71d81d6.tar.gz jitsi-23818044bd4385d8a7f8e4f38b2514a6d71d81d6.tar.bz2 |
Conditionally enable basic poller as fall back mechanism next to MONITOR/WATCH pub/sub presence watcher.
Diffstat (limited to 'src/net/java')
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/irc/PresenceManager.java | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/irc/PresenceManager.java b/src/net/java/sip/communicator/impl/protocol/irc/PresenceManager.java index 51d04f3..57a5f0d 100644 --- a/src/net/java/sip/communicator/impl/protocol/irc/PresenceManager.java +++ b/src/net/java/sip/communicator/impl/protocol/irc/PresenceManager.java @@ -161,6 +161,8 @@ public class PresenceManager this.isupportAwayLen = parseISupportAwayLen(this.connectionState); this.isupportMonitor = parseISupportMonitor(this.connectionState); this.isupportWatch = parseISupportWatch(this.connectionState); + final boolean enablePresencePolling = + config.isContactPresenceTaskEnabled(); if (this.isupportMonitor != null) { // Share a list of monitored nicks between the @@ -174,15 +176,20 @@ public class PresenceManager new MonitorPresenceWatcher(this.irc, this.connectionState, nickWatchList, monitoredNicks, this.operationSet, this.isupportMonitor); - // FIXME only set up basic poller if option enabled? - // Create a dynamic set that automatically computes the - // difference between the full nick list and the list of nicks - // that are subscribed to MONITOR. The difference will be the - // result that is used by the basic poller. - final Set<String> unmonitoredNicks = - new DynamicDifferenceSet<String>(nickWatchList, monitoredNicks); - new BasicPollerPresenceWatcher(this.irc, this.connectionState, - this.operationSet, unmonitoredNicks, this.serverIdentity); + if (enablePresencePolling) + { + // Enable basic poller as fall back mechanism. + + // Create a dynamic set that automatically computes the + // difference between the full nick list and the list of nicks + // that are subscribed to MONITOR. The difference will be the + // result that is used by the basic poller. + final Set<String> unmonitoredNicks = + new DynamicDifferenceSet<String>(nickWatchList, + monitoredNicks); + new BasicPollerPresenceWatcher(this.irc, this.connectionState, + this.operationSet, unmonitoredNicks, this.serverIdentity); + } } else if (this.isupportWatch != null) { @@ -197,18 +204,24 @@ public class PresenceManager new WatchPresenceWatcher(this.irc, this.connectionState, nickWatchList, monitoredNicks, this.operationSet, this.isupportWatch); - // FIXME only set up basic poller if option enabled? - // Create a dynamic set that automatically computes the - // difference between the full nick list and the list of nicks - // that are subscribed to WATCH. The difference will be the - // result that is used by the basic poller. - final Set<String> unmonitoredNicks = - new DynamicDifferenceSet<String>(nickWatchList, monitoredNicks); - new BasicPollerPresenceWatcher(this.irc, this.connectionState, - this.operationSet, unmonitoredNicks, this.serverIdentity); - } - else if (config.isContactPresenceTaskEnabled()) + if (enablePresencePolling) + { + // Enable basic poller as fall back mechanism. + + // Create a dynamic set that automatically computes the + // difference between the full nick list and the list of nicks + // that are subscribed to WATCH. The difference will be the + // result that is used by the basic poller. + final Set<String> unmonitoredNicks = + new DynamicDifferenceSet<String>(nickWatchList, + monitoredNicks); + new BasicPollerPresenceWatcher(this.irc, this.connectionState, + this.operationSet, unmonitoredNicks, this.serverIdentity); + } + } + else if (enablePresencePolling) { + // Enable basic poller as the only presence mechanism. this.watcher = new BasicPollerPresenceWatcher(this.irc, this.connectionState, this.operationSet, nickWatchList, this.serverIdentity); |