From 035bbea83792fbb33c3c61a57ddc3f5a19490a25 Mon Sep 17 00:00:00 2001 From: damencho Date: Sat, 5 Dec 2015 22:31:44 -0600 Subject: [PATCH] Reply with service-unavailable for unhandled IQ requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit instead of feature-not-implemented. Changes to send service-unavailable for not handled iq as said in RFC6120 ยง 8.4: https://tools.ietf.org/html/rfc6120#page-128 """ o If an intended recipient receives an IQ stanza of type "get" or "set" containing a child element qualified by a namespace it does not understand, then the entity MUST return an IQ stanza of type "error" with an error condition of . """ --- .../java/org/jivesoftware/smack/AbstractXMPPConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java index 98a38a83b..45d5abc0f 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java @@ -1049,9 +1049,9 @@ public abstract class AbstractXMPPConnection implements XMPPConnection { return; } // If the IQ stanza is of type "get" or "set" with no registered IQ request handler, then answer an - // IQ of type "error" with code 501 ("feature-not-implemented") + // IQ of type 'error' with condition 'service-unavailable'. ErrorIQ errorIQ = IQ.createErrorResponse(iq, new XMPPError( - XMPPError.Condition.feature_not_implemented)); + XMPPError.Condition.service_unavailable)); try { sendStanza(errorIQ); }