|
@@ -230,6 +230,9 @@ public final class Server extends WritableFrameContainer implements Serializable
|
230
|
230
|
case CONNECTING:
|
231
|
231
|
disconnect(configManager.getOption(DOMAIN_GENERAL, "quitmessage"));
|
232
|
232
|
break;
|
|
233
|
+ case DISCONNECTING:
|
|
234
|
+ onSocketClosed();
|
|
235
|
+ break;
|
233
|
236
|
default:
|
234
|
237
|
// Do nothing
|
235
|
238
|
break;
|
|
@@ -327,24 +330,24 @@ public final class Server extends WritableFrameContainer implements Serializable
|
327
|
330
|
break;
|
328
|
331
|
}
|
329
|
332
|
|
330
|
|
- myState = ServerState.DISCONNECTED;
|
|
333
|
+ myState = ServerState.DISCONNECTING;
|
331
|
334
|
}
|
332
|
335
|
|
333
|
336
|
removeInvites();
|
334
|
337
|
updateIcon();
|
335
|
338
|
|
336
|
|
- if (parser != null && parser.getSocketState() == IRCParser.STATE_OPEN) {
|
|
339
|
+ if (parser != null) {
|
337
|
340
|
parser.disconnect(reason);
|
|
341
|
+ }
|
338
|
342
|
|
339
|
|
- if (configManager.getOptionBool(DOMAIN_GENERAL, "closechannelsonquit", false)) {
|
340
|
|
- closeChannels();
|
341
|
|
- } else {
|
342
|
|
- clearChannels();
|
343
|
|
- }
|
|
343
|
+ if (configManager.getOptionBool(DOMAIN_GENERAL, "closechannelsonquit", false)) {
|
|
344
|
+ closeChannels();
|
|
345
|
+ } else {
|
|
346
|
+ clearChannels();
|
|
347
|
+ }
|
344
|
348
|
|
345
|
|
- if (configManager.getOptionBool(DOMAIN_GENERAL, "closequeriesonquit", false)) {
|
346
|
|
- closeQueries();
|
347
|
|
- }
|
|
349
|
+ if (configManager.getOptionBool(DOMAIN_GENERAL, "closequeriesonquit", false)) {
|
|
350
|
+ closeQueries();
|
348
|
351
|
}
|
349
|
352
|
}
|
350
|
353
|
|
|
@@ -1071,9 +1074,13 @@ public final class Server extends WritableFrameContainer implements Serializable
|
1071
|
1074
|
handleNotification("socketClosed", getName());
|
1072
|
1075
|
|
1073
|
1076
|
ActionManager.processEvent(CoreActionType.SERVER_DISCONNECTED, null, this);
|
|
1077
|
+
|
|
1078
|
+ eventHandler.unregisterCallbacks();
|
1074
|
1079
|
|
1075
|
1080
|
synchronized (myState) {
|
1076
|
|
- if (myState == ServerState.CLOSING || myState == ServerState.DISCONNECTED) {
|
|
1081
|
+ if (myState == ServerState.CLOSING
|
|
1082
|
+ || myState == ServerState.DISCONNECTED
|
|
1083
|
+ || myState == ServerState.DISCONNECTING) {
|
1077
|
1084
|
// This has been triggered via .disconect()
|
1078
|
1085
|
return;
|
1079
|
1086
|
}
|
|
@@ -1113,7 +1120,6 @@ public final class Server extends WritableFrameContainer implements Serializable
|
1113
|
1120
|
return;
|
1114
|
1121
|
}
|
1115
|
1122
|
|
1116
|
|
- assert myState == ServerState.CONNECTING;
|
1117
|
1123
|
myState = ServerState.TRANSIENTLY_DISCONNECTED;
|
1118
|
1124
|
}
|
1119
|
1125
|
|