1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 06:12:05 +01:00

Merge pull request #179 from damencho/4.2

Makes xmpperror descriptive text optional as said in the rfc.
This commit is contained in:
Florian Schmaus 2017-11-09 18:26:14 +01:00 committed by GitHub
commit fe61922fb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -271,9 +271,13 @@ public class XMPPError extends AbstractError {
}
public static XMPPError.Builder from(Condition condition, String descriptiveText) {
Map<String, String> descriptiveTexts = new HashMap<String, String>();
descriptiveTexts.put("en", descriptiveText);
return getBuilder().setCondition(condition).setDescriptiveTexts(descriptiveTexts);
XMPPError.Builder builder = getBuilder().setCondition(condition);
if (descriptiveText != null) {
Map<String, String> descriptiveTexts = new HashMap<>();
descriptiveTexts.put("en", descriptiveText);
builder.setDescriptiveTexts(descriptiveTexts);
}
return builder;
}
public static Builder getBuilder() {