aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Account.java5
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java12
-rw-r--r--src/main/res/values/strings.xml1
3 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Account.java b/src/main/java/eu/siacs/conversations/entities/Account.java
index 1a7798b2d..c6b655d0a 100644
--- a/src/main/java/eu/siacs/conversations/entities/Account.java
+++ b/src/main/java/eu/siacs/conversations/entities/Account.java
@@ -94,7 +94,8 @@ public class Account extends AbstractEntity {
SECURITY_ERROR(true),
INCOMPATIBLE_SERVER(true),
TOR_NOT_AVAILABLE(true),
- BIND_FAILURE(true);
+ BIND_FAILURE(true),
+ HOST_UNKNOWN(true);
private final boolean isError;
@@ -142,6 +143,8 @@ public class Account extends AbstractEntity {
return R.string.account_status_tor_unavailable;
case BIND_FAILURE:
return R.string.account_status_bind_failure;
+ case HOST_UNKNOWN:
+ return R.string.account_status_host_unknown;
default:
return R.string.account_status_unknown;
}
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index c0d22d4b5..6241140c6 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -893,6 +893,7 @@ public class XmppConnection implements Runnable {
}
public void resetEverything() {
+ resetAttemptCount();
resetStreamId();
clearIqCallbacks();
mStanzaQueue.clear();
@@ -1186,15 +1187,20 @@ public class XmppConnection implements Runnable {
private void processStreamError(final Tag currentTag)
throws XmlPullParserException, IOException {
final Element streamError = tagReader.readElement(currentTag);
- if (streamError != null && streamError.hasChild("conflict")) {
+ if (streamError == null) {
+ return;
+ }
+ Log.d(Config.LOGTAG,account.getJid().toBareJid()+": stream error "+streamError.toString());
+ if (streamError.hasChild("conflict")) {
final String resource = account.getResource().split("\\.")[0];
account.setResource(resource + "." + nextRandomId());
Log.d(Config.LOGTAG,
account.getJid().toBareJid() + ": switching resource due to conflict ("
+ account.getResource() + ")");
- } else if (streamError != null) {
- Log.d(Config.LOGTAG,account.getJid().toBareJid()+": stream error "+streamError.toString());
+ } else if (streamError.hasChild("host-unknown")) {
+ changeStatus(Account.State.HOST_UNKNOWN);
}
+ forceCloseSocket();
}
private void sendStartStream() throws IOException {
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 0d7edfcd5..f441fab83 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -561,6 +561,7 @@
<string name="download_started">Download started</string>
<string name="account_status_tor_unavailable">Tor network unavailable</string>
<string name="account_status_bind_failure">Bind failure</string>
+ <string name="account_status_host_unknown">Domain not recognized</string>
<string name="server_info_broken">Broken</string>
<string name="pref_presence_settings">Presence</string>
<string name="pref_away_when_screen_off">Away when screen is off</string>