Browse Source

Merge pull request #783 from csmith/master

Fix a couple of issues with closing channels.
pull/784/head
Chris Smith 7 years ago
parent
commit
b19ad5e79e

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

@@ -189,7 +189,7 @@ public class GroupChatManagerImpl implements GroupChatManager {
189 189
 
190 190
     @Handler
191 191
     void handleChannelClosing(final ChannelClosedEvent event) {
192
-        if (event.getChannel().getConnection().equals(connection)) {
192
+        if (connection.equals(event.getChannel().getConnection().orElse(null))) {
193 193
             final GroupChat channel = event.getChannel();
194 194
             connection.getWindowModel().getInputModel().get().getTabCompleter()
195 195
                     .removeEntry(TabCompletionType.CHANNEL, channel.getName());

+ 2
- 0
src/main/java/com/dmdirc/Server.java View File

@@ -205,6 +205,7 @@ public class Server implements Connection {
205 205
 
206 206
         highlightManager = new HighlightManager(windowModel);
207 207
         windowModel.getEventBus().subscribe(highlightManager);
208
+        windowModel.getEventBus().subscribe(groupChatManager);
208 209
         windowModel.getEventBus().subscribe(this);
209 210
     }
210 211
 
@@ -675,6 +676,7 @@ public class Server implements Connection {
675 676
             synchronized (myStateLock) {
676 677
                 eventHandler.unregisterCallbacks();
677 678
                 windowModel.getConfigManager().removeListener(configListener);
679
+                windowModel.getEventBus().unsubscribe(groupChatManager);
678 680
                 windowModel.getEventBus().unsubscribe(highlightManager);
679 681
                 executorService.shutdown();
680 682
 

Loading…
Cancel
Save