mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
Makes xmpperror descriptive text optional as said in the rfc.
This commit is contained in:
parent
0729392ab8
commit
a0b0b5a63b
1 changed files with 7 additions and 3 deletions
|
@ -271,9 +271,13 @@ public class XMPPError extends AbstractError {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static XMPPError.Builder from(Condition condition, String descriptiveText) {
|
public static XMPPError.Builder from(Condition condition, String descriptiveText) {
|
||||||
Map<String, String> descriptiveTexts = new HashMap<String, String>();
|
XMPPError.Builder builder = getBuilder().setCondition(condition);
|
||||||
descriptiveTexts.put("en", descriptiveText);
|
if (descriptiveText != null) {
|
||||||
return getBuilder().setCondition(condition).setDescriptiveTexts(descriptiveTexts);
|
Map<String, String> descriptiveTexts = new HashMap<>();
|
||||||
|
descriptiveTexts.put("en", descriptiveText);
|
||||||
|
builder.setDescriptiveTexts(descriptiveTexts);
|
||||||
|
}
|
||||||
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Builder getBuilder() {
|
public static Builder getBuilder() {
|
||||||
|
|
Loading…
Reference in a new issue