@@ -47,20 +47,15 @@ public static boolean checkConditions(Screen screen) {
4747 AutoReconnect .lastDcReasonStr = reasonStr ;
4848 AutoReconnect .lastDcReasonKey = null ;
4949 boolean match = false ;
50-
51- // Check regex conditions
52- for (Pattern condition : AutoReconnect .conditionPatterns ) {
53- if (condition .matcher (reasonStr ).find ()) {
54- AutoReconnect .LOG .info ("Matched pattern '{}' against reason '{}'" ,
55- condition , reasonStr );
56- match = true ;
57- break ;
58- }
59- }
60- // Check key conditions
61- if (!match && reason .getContents () instanceof TranslatableContents tc ) {
50+
51+ if (reason .getContents () instanceof TranslatableContents tc ) {
6252 String key = tc .getKey ();
6353 AutoReconnect .lastDcReasonKey = key ;
54+
55+ // Check for transfer packet
56+ if (key .equals ("disconnect.transfer" )) return false ;
57+
58+ // Check key conditions
6459 for (String condition : Config .options ().conditionKeys ) {
6560 if (key .contains (condition )) {
6661 AutoReconnect .LOG .info ("Matched key '{}' against reason key '{}'" ,
@@ -70,6 +65,19 @@ public static boolean checkConditions(Screen screen) {
7065 }
7166 }
7267 }
68+
69+ if (!match ) {
70+ // Check regex conditions
71+ for (Pattern condition : AutoReconnect .conditionPatterns ) {
72+ if (condition .matcher (reasonStr ).find ()) {
73+ AutoReconnect .LOG .info ("Matched pattern '{}' against reason '{}'" ,
74+ condition , reasonStr );
75+ match = true ;
76+ break ;
77+ }
78+ }
79+ }
80+
7381 if (Config .options ().conditionType ) {
7482 return match ;
7583 } else {
0 commit comments