aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r--src/main/java/de/pixart/messenger/utils/Resolver.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/Resolver.java b/src/main/java/de/pixart/messenger/utils/Resolver.java
index 31e0b3dd4..03ad00145 100644
--- a/src/main/java/de/pixart/messenger/utils/Resolver.java
+++ b/src/main/java/de/pixart/messenger/utils/Resolver.java
@@ -5,6 +5,7 @@ import android.support.annotation.NonNull;
import android.util.Log;
import java.io.IOException;
+import java.net.Inet4Address;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Collections;
@@ -156,6 +157,12 @@ public class Resolver {
if (directTls == result.directTls) {
if (ip == null && result.ip == null) {
return 0;
+ } else if (ip != null && result.ip != null) {
+ if (ip instanceof Inet4Address && result.ip instanceof Inet4Address) {
+ return 0;
+ } else {
+ return ip instanceof Inet4Address ? -1 : 1;
+ }
} else {
return ip != null ? -1 : 1;
}