]> granicus.if.org Git - ejabberd/commitdiff
mod_push: Further improve handling of carbons
authorHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 12 Jun 2018 22:25:14 +0000 (00:25 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Tue, 12 Jun 2018 22:25:14 +0000 (00:25 +0200)
Also check for carbon-copied messages (with a body) in the queue of
unacknowledged stanzas.

src/mod_push.erl

index eb06e41b0e80c3c9a0611b441b6be3aa64f71a21..db479cfc7525dd0e1bbce540e7ef1e164260f2f5 100644 (file)
@@ -389,7 +389,7 @@ c2s_session_pending(#{push_enabled := true, mgmt_queue := Queue} = State) ->
        Len when Len > 0 ->
            ?DEBUG("Notifying client of unacknowledged stanza(s)", []),
            Pkt = mod_stream_mgmt:queue_find(fun is_message_with_body/1, Queue),
-           notify(State, Pkt),
+           notify(State, xmpp_util:unwrap_carbon(Pkt)),
            State;
        0 ->
            State
@@ -467,7 +467,8 @@ notify(LServer, PushLJID, Node, XData, Pkt, HandleResponse) ->
 %%--------------------------------------------------------------------
 -spec is_message_with_body(stanza()) -> boolean().
 is_message_with_body(#message{} = Msg) ->
-    get_body_text(Msg) /= none;
+    Msg1 = xmpp_util:unwrap_carbon(Msg),
+    get_body_text(Msg1) /= none;
 is_message_with_body(_Stanza) ->
     false.