]> granicus.if.org Git - ejabberd/commitdiff
Omit XML namespace declaration for <iq/> stanzas
authorHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 20 May 2014 22:07:57 +0000 (00:07 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 20 May 2014 22:07:57 +0000 (00:07 +0200)
Only the child elements of <iq/> stanzas are qualified by the namespaces
in question, not the <iq/> stanzas themselves.

This change just clarifies the code.  It doesn't alter the behaviour, as
those <iq/> stanzas are handed over to jlib:iq_to_xml/1, and that
function ignores the 'xmlns' attribute anyway.

src/ejabberd_c2s.erl

index 85a696c7f8c36ad5c53c8038ab1103bcc982315f..00ecaa00878036d46963da1423462b1a4e7e2ab6 100644 (file)
@@ -1395,7 +1395,6 @@ handle_info({route, _From, _To, {broadcast, Data}},
                     fsm_next_state(StateName, StateData);
                 NewPL ->
                     PrivPushIQ = #iq{type = set,
-                                     xmlns = ?NS_PRIVACY,
                                      id = <<"push",
                                             (randoms:get_string())/binary>>,
                                      sub_el =
@@ -2557,8 +2556,7 @@ route_blocking(What, StateData) ->
                  #xmlel{name = <<"unblock">>,
                         attrs = [{<<"xmlns">>, ?NS_BLOCKING}], children = []}
            end,
-    PrivPushIQ = #iq{type = set, xmlns = ?NS_BLOCKING,
-                    id = <<"push">>, sub_el = [SubEl]},
+    PrivPushIQ = #iq{type = set, id = <<"push">>, sub_el = [SubEl]},
     PrivPushEl =
        jlib:replace_from_to(jlib:jid_remove_resource(StateData#state.jid),
                             StateData#state.jid, jlib:iq_to_xml(PrivPushIQ)),