Browse Source

Remove channel who functionality.

This will go in a plugin instead.
pull/511/head
Chris Smith 9 years ago
parent
commit
3fa826e95a

+ 0
- 10
src/com/dmdirc/ChannelMap.java View File

@@ -131,14 +131,4 @@ public class ChannelMap {
131 131
                 .collect(Collectors.toList());
132 132
     }
133 133
 
134
-    /**
135
-     * Creates a runnable that, when run, will cause each channel in the map at that time to check
136
-     * its 'who' status.
137
-     *
138
-     * @return A new runnable.
139
-     */
140
-    public Runnable getWhoRunnable() {
141
-        return () -> channels.values().forEach(Channel::checkWho);
142
-    }
143
-
144 134
 }

+ 1
- 20
src/com/dmdirc/GroupChatManagerImpl.java View File

@@ -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

+ 2
- 7
src/com/dmdirc/GroupChatManagerImplFactory.java View File

@@ -25,8 +25,6 @@ package com.dmdirc;
25 25
 import com.dmdirc.interfaces.Connection;
26 26
 import com.dmdirc.interfaces.config.IdentityFactory;
27 27
 
28
-import java.util.concurrent.ScheduledExecutorService;
29
-
30 28
 import javax.inject.Inject;
31 29
 import javax.inject.Provider;
32 30
 import javax.inject.Singleton;
@@ -48,11 +46,8 @@ public class GroupChatManagerImplFactory {
48 46
         this.channelFactory = channelFactory;
49 47
     }
50 48
 
51
-    public GroupChatManagerImpl create(
52
-            final Connection connection,
53
-            final ScheduledExecutorService executorService) {
54
-        return new GroupChatManagerImpl(connection, identityFactory, channelFactory.get(),
55
-                executorService);
49
+    public GroupChatManagerImpl create(final Connection connection) {
50
+        return new GroupChatManagerImpl(connection, identityFactory, channelFactory.get());
56 51
     }
57 52
 
58 53
 }

+ 1
- 1
src/com/dmdirc/Server.java View File

@@ -213,7 +213,7 @@ public class Server extends FrameContainer implements Connection {
213 213
         this.userSettings = userSettings;
214 214
         this.messageEncoderFactory = messageEncoderFactory;
215 215
         this.userManager = userManager;
216
-        this.groupChatManager = groupChatManagerFactory.create(this, executorService);
216
+        this.groupChatManager = groupChatManagerFactory.create(this);
217 217
         this.inviteManager = new InviteManagerImpl(this);
218 218
 
219 219
         awayMessage = Optional.empty();

Loading…
Cancel
Save