]> granicus.if.org Git - ejabberd/commitdiff
ejabberd_c2s: Don't drop 'user_send_packet' result
authorHolger Weiss <holger@zedat.fu-berlin.de>
Mon, 20 Feb 2017 12:07:34 +0000 (13:07 +0100)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Mon, 20 Feb 2017 12:07:34 +0000 (13:07 +0100)
When handling a <session/> IQ, use the stanza returned by the
'user_send_packet' hook.

Thanks to Evgeniy for spotting this.

src/ejabberd_c2s.erl

index dd022149613b6faf2e4ae60d04988ff603a572dd..59b5c32a98d9db9c75fe6681887450f9860f5f5c 100644 (file)
@@ -449,11 +449,11 @@ handle_authenticated_packet(Pkt, #{lserver := LServer, jid := JID,
        drop ->
            State2;
        #iq{type = set, sub_els = [_]} ->
-           case xmpp:get_subtag(Pkt1, #xmpp_session{}) of
+           case xmpp:get_subtag(Pkt2, #xmpp_session{}) of
                #xmpp_session{} ->
-                   send(State2, xmpp:make_iq_result(Pkt1));
+                   send(State2, xmpp:make_iq_result(Pkt2));
                _ ->
-                   check_privacy_then_route(State2, Pkt1)
+                   check_privacy_then_route(State2, Pkt2)
            end;
        #presence{to = #jid{luser = LUser, lserver = LServer,
                            lresource = <<"">>}} ->