diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/xmpp')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/pep/PublishOptions.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/pep/PublishOptions.java b/src/main/java/de/pixart/messenger/xmpp/pep/PublishOptions.java index 56b85169c..53b12d239 100644 --- a/src/main/java/de/pixart/messenger/xmpp/pep/PublishOptions.java +++ b/src/main/java/de/pixart/messenger/xmpp/pep/PublishOptions.java @@ -2,6 +2,10 @@ package de.pixart.messenger.xmpp.pep; import android.os.Bundle; +import de.pixart.messenger.utils.Namespace; +import de.pixart.messenger.xml.Element; +import de.pixart.messenger.xmpp.stanzas.IqPacket; + public class PublishOptions { private PublishOptions() { @@ -21,4 +25,9 @@ public class PublishOptions { return options; } + public static boolean preconditionNotMet(IqPacket response) { + final Element error = response.getType() == IqPacket.TYPE.ERROR ? response.findChild("error") : null; + return error != null && error.hasChild("precondition-not-met", Namespace.PUBSUB_ERROR); + } + }
\ No newline at end of file |