aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/xmpp
diff options
context:
space:
mode:
authorChristian S <christian@pix-art.de>2016-01-23 12:30:02 +0100
committerChristian S <christian@pix-art.de>2016-01-23 12:30:02 +0100
commit0196442c37d5d172ba75986495977bf16f3095dc (patch)
treed1a549aa917b8ea5e30ae859f2df8ec399c0dcc0 /src/main/java/eu/siacs/conversations/xmpp
parent07d139decd7ed9f616b15539bbca00e244eb8a29 (diff)
parentba98fe4f864a7e9df9b001a84c5c4126c9d107be (diff)
Merge branch 'siacs/master' into development
Diffstat (limited to 'src/main/java/eu/siacs/conversations/xmpp')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java5
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/forms/Data.java6
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/forms/Field.java12
3 files changed, 20 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index ec751e9ca..d957a60d8 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -727,7 +727,7 @@ public class XmppConnection implements Runnable {
if (this.streamFeatures.hasChild("starttls") && !features.encryptionEnabled) {
sendStartTLS();
} else if (this.streamFeatures.hasChild("register") && account.isOptionSet(Account.OPTION_REGISTER)) {
- if (features.encryptionEnabled) {
+ if (features.encryptionEnabled || Config.ALLOW_NON_TLS_CONNECTIONS) {
sendRegistryRequest();
} else {
throw new IncompatibleServerException();
@@ -737,7 +737,8 @@ public class XmppConnection implements Runnable {
changeStatus(Account.State.REGISTRATION_NOT_SUPPORTED);
disconnect(true);
} else if (this.streamFeatures.hasChild("mechanisms")
- && shouldAuthenticate && features.encryptionEnabled) {
+ && shouldAuthenticate
+ && (features.encryptionEnabled || Config.ALLOW_NON_TLS_CONNECTIONS)) {
final List<String> mechanisms = extractMechanisms(streamFeatures
.findChild("mechanisms"));
final Element auth = new Element("auth");
diff --git a/src/main/java/eu/siacs/conversations/xmpp/forms/Data.java b/src/main/java/eu/siacs/conversations/xmpp/forms/Data.java
index 44794c80c..d05c9abb3 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/forms/Data.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/forms/Data.java
@@ -76,10 +76,14 @@ public class Data extends Element {
}
public void setFormType(String formType) {
- this.put("FORM_TYPE",formType);
+ this.put("FORM_TYPE", formType);
}
public String getFormType() {
return this.getAttribute("FORM_TYPE");
}
+
+ public String getTitle() {
+ return findChildContent("title");
+ }
}
diff --git a/src/main/java/eu/siacs/conversations/xmpp/forms/Field.java b/src/main/java/eu/siacs/conversations/xmpp/forms/Field.java
index 3ec1f2149..c1fc808dc 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/forms/Field.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/forms/Field.java
@@ -51,4 +51,16 @@ public class Field extends Element {
public String getValue() {
return findChildContent("value");
}
+
+ public String getLabel() {
+ return getAttribute("label");
+ }
+
+ public String getType() {
+ return getAttribute("type");
+ }
+
+ public boolean isRequired() {
+ return hasChild("required");
+ }
}