made payment required error standard compliant

This commit is contained in:
Daniel Gultsch 2016-08-25 23:42:42 +02:00
parent cbda5a5016
commit e98ab37c9d

View File

@ -510,11 +510,12 @@ public class XmppConnection implements Runnable {
break; break;
} else if (nextTag.isStart("failure")) { } else if (nextTag.isStart("failure")) {
final Element failure = tagReader.readElement(nextTag); final Element failure = tagReader.readElement(nextTag);
final String accountDisabled = failure.findChildContent("account-disabled"); final String text = failure.findChildContent("text");
if (accountDisabled != null if (failure.hasChild("account-disabled")
&& accountDisabled.contains("renew") && text != null
&& text.contains("renew")
&& Config.MAGIC_CREATE_DOMAIN != null && Config.MAGIC_CREATE_DOMAIN != null
&& accountDisabled.contains(Config.MAGIC_CREATE_DOMAIN)) { && text.contains(Config.MAGIC_CREATE_DOMAIN)) {
throw new PaymentRequiredException(); throw new PaymentRequiredException();
} else { } else {
throw new UnauthorizedException(); throw new UnauthorizedException();