]> granicus.if.org Git - ejabberd/commitdiff
Don't let MAM messages go into offline storage
authorHolger Weiss <holger@zedat.fu-berlin.de>
Wed, 12 Oct 2016 21:10:25 +0000 (23:10 +0200)
committerHolger Weiss <holger@zedat.fu-berlin.de>
Wed, 12 Oct 2016 21:10:25 +0000 (23:10 +0200)
src/mod_mam.erl

index f6d3c8f1f12b599ff3177773e26587c62dce24af..8f6492047bbcbcef4af3de7a74ef0bdf5ed6481b 100644 (file)
@@ -966,13 +966,14 @@ send(From, To, Msgs, RSM, Count, IsComplete, #iq{sub_el = SubEl} = IQ) ->
                      NS == ?NS_MAM_0; NS == ?NS_MAM_1 ->
                           [{<<"complete">>, jlib:atom_to_binary(IsComplete)}]
                   end,
+    Hint = [#xmlel{name = <<"no-store">>, attrs = [{<<"xmlns">>, ?NS_HINTS}]}],
     Els = lists:map(
            fun({ID, _IDInt, El}) ->
                    #xmlel{name = <<"message">>,
                           children = [#xmlel{name = <<"result">>,
                                              attrs = [{<<"xmlns">>, NS},
                                                       {<<"id">>, ID}|QIDAttr],
-                                             children = [El]}]}
+                                             children = [El]} | Hint]}
            end, Msgs),
     RSMOut = make_rsm_out(Msgs, RSM, Count, QIDAttr ++ CompleteAttr, NS),
     if NS == ?NS_MAM_TMP; NS == ?NS_MAM_1 ->
@@ -990,7 +991,7 @@ send(From, To, Msgs, RSM, Count, IsComplete, #iq{sub_el = SubEl} = IQ) ->
              end, Els),
            ejabberd_router:route(
              To, From, #xmlel{name = <<"message">>,
-                              children = RSMOut}),
+                              children = RSMOut ++ Hint}),
            ignore
     end.