diff options
author | Danny van Heumen <danny@dannyvanheumen.nl> | 2015-02-13 23:47:41 +0100 |
---|---|---|
committer | Danny van Heumen <danny@dannyvanheumen.nl> | 2015-03-13 19:35:55 +0100 |
commit | f10a61f12a281e0dc627b0822e96f4cbe9beb360 (patch) | |
tree | 2fe383beb714448973c9e5ccdb99e989dc988c01 /src/net/java/sip/communicator/impl/protocol/irc/MonitorPresenceWatcher.java | |
parent | 44b75018120003cab156e8ee162e1bfefd0229d3 (diff) | |
download | jitsi-f10a61f12a281e0dc627b0822e96f4cbe9beb360.zip jitsi-f10a61f12a281e0dc627b0822e96f4cbe9beb360.tar.gz jitsi-f10a61f12a281e0dc627b0822e96f4cbe9beb360.tar.bz2 |
Immediately remove nick from MONITOR monitored list, after 'MONITOR - nick' command is issued, since we will not get confirmation of removal.
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/irc/MonitorPresenceWatcher.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/irc/MonitorPresenceWatcher.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/irc/MonitorPresenceWatcher.java b/src/net/java/sip/communicator/impl/protocol/irc/MonitorPresenceWatcher.java index 31e1405..be33967 100644 --- a/src/net/java/sip/communicator/impl/protocol/irc/MonitorPresenceWatcher.java +++ b/src/net/java/sip/communicator/impl/protocol/irc/MonitorPresenceWatcher.java @@ -49,6 +49,15 @@ class MonitorPresenceWatcher private final Set<String> nickWatchList; /** + * List of monitored nicks. + * + * The instance is stored here only for access in order to remove a nick + * from the list, since 'MONITOR - ' command does not reply so we cannot + * manage list removals from the reply listener. + */ + private final Set<String> monitoredList; + + /** * Constructor. * * @param irc the IRCApi instance @@ -80,7 +89,12 @@ class MonitorPresenceWatcher throw new IllegalArgumentException("nickWatchList cannot be null"); } this.nickWatchList = nickWatchList; - this.irc.addListener(new MonitorReplyListener(monitored, operationSet)); + if (monitored == null) + { + throw new IllegalArgumentException("monitored cannot be null"); + } + this.monitoredList = monitored; + this.irc.addListener(new MonitorReplyListener(this.monitoredList, operationSet)); setUpMonitor(this.irc, this.nickWatchList, maxListSize); LOGGER.debug("MONITOR presence watcher initialized."); } @@ -141,7 +155,9 @@ class MonitorPresenceWatcher LOGGER.trace("Removing nick '" + nick + "' from MONITOR watch list."); this.nickWatchList.remove(nick); this.irc.rawMessage("MONITOR - " + nick); - // FIXME Also remove from monitoredNicks list! + // 'MONITOR - nick' command does not send confirmation, so immediately + // remove nick from monitored list. + this.monitoredList.remove(nick); } /** |