|
@@ -39,9 +39,6 @@ import java.util.Date;
|
39
|
39
|
import java.util.HashSet;
|
40
|
40
|
import java.util.List;
|
41
|
41
|
import java.util.Optional;
|
42
|
|
-import java.util.concurrent.ScheduledExecutorService;
|
43
|
|
-import java.util.concurrent.ScheduledFuture;
|
44
|
|
-import java.util.concurrent.TimeUnit;
|
45
|
42
|
import java.util.stream.Collectors;
|
46
|
43
|
|
47
|
44
|
import net.engio.mbassy.listener.Handler;
|
|
@@ -65,19 +62,12 @@ public class GroupChatManagerImpl implements GroupChatManager {
|
65
|
62
|
/** A set of channels we want to join without focusing. */
|
66
|
63
|
private final Collection<String> backgroundChannels = new HashSet<>();
|
67
|
64
|
|
68
|
|
- private final ScheduledExecutorService executorService;
|
69
|
|
-
|
70
|
|
- /** The future used when a who timer is scheduled. */
|
71
|
|
- private ScheduledFuture<?> whoTimerFuture;
|
72
|
|
-
|
73
|
65
|
public GroupChatManagerImpl(final Connection connection,
|
74
|
66
|
final IdentityFactory identityFactory,
|
75
|
|
- final ChannelFactory channelFactory,
|
76
|
|
- final ScheduledExecutorService executorService) {
|
|
67
|
+ final ChannelFactory channelFactory) {
|
77
|
68
|
this.connection = connection;
|
78
|
69
|
this.identityFactory = identityFactory;
|
79
|
70
|
this.channelFactory = channelFactory;
|
80
|
|
- this.executorService = executorService;
|
81
|
71
|
}
|
82
|
72
|
|
83
|
73
|
@Override
|
|
@@ -188,10 +178,6 @@ public class GroupChatManagerImpl implements GroupChatManager {
|
188
|
178
|
}
|
189
|
179
|
|
190
|
180
|
public void handleSocketClosed() {
|
191
|
|
- if (whoTimerFuture != null) {
|
192
|
|
- whoTimerFuture.cancel(false);
|
193
|
|
- }
|
194
|
|
-
|
195
|
181
|
channels.resetAll();
|
196
|
182
|
|
197
|
183
|
if (connection.getWindowModel().getConfigManager()
|
|
@@ -209,11 +195,6 @@ public class GroupChatManagerImpl implements GroupChatManager {
|
209
|
195
|
requests.addAll(channels.asJoinRequests());
|
210
|
196
|
}
|
211
|
197
|
join(requests.toArray(new ChannelJoinRequest[requests.size()]));
|
212
|
|
-
|
213
|
|
- final int whoTime = connection.getWindowModel().getConfigManager()
|
214
|
|
- .getOptionInt("general", "whotime");
|
215
|
|
- whoTimerFuture = executorService.scheduleAtFixedRate(
|
216
|
|
- channels.getWhoRunnable(), whoTime, whoTime, TimeUnit.MILLISECONDS);
|
217
|
198
|
}
|
218
|
199
|
|
219
|
200
|
@Handler
|