mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Revert "Run user_receive_packet in send_message so MAM stores also incoming (#3377)"
This reverts commit 43f813d6f8
.
This commit is contained in:
parent
43f813d6f8
commit
a75966f1a2
@ -1494,18 +1494,14 @@ send_message(Type, From, To, Subject, Body) ->
|
|||||||
#xmlel{name = <<"body">>,
|
#xmlel{name = <<"body">>,
|
||||||
children = [{xmlcdata, Body}]}]},
|
children = [{xmlcdata, Body}]}]},
|
||||||
?NS_CLIENT, CodecOpts) of
|
?NS_CLIENT, CodecOpts) of
|
||||||
#message{from = FromJid, to = ToJid} = Msg1 ->
|
#message{from = JID} = Msg ->
|
||||||
Msg = xmpp:put_meta(Msg1, stanza_id, mod_mam:make_id()),
|
State = #{jid => JID},
|
||||||
ejabberd_hooks:run_fold(user_send_packet, FromJid#jid.lserver,
|
ejabberd_hooks:run_fold(user_send_packet, JID#jid.lserver, {Msg, State}, []),
|
||||||
{Msg, #{jid => FromJid}}, []),
|
|
||||||
ejabberd_hooks:run_fold(user_receive_packet, FromJid#jid.lserver,
|
|
||||||
{Msg, #{jid => ToJid}}, []),
|
|
||||||
ejabberd_router:route(Msg)
|
ejabberd_router:route(Msg)
|
||||||
catch _:{xmpp_codec, Why} ->
|
catch _:{xmpp_codec, Why} ->
|
||||||
{error, xmpp:format_error(Why)}
|
{error, xmpp:format_error(Why)}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
send_stanza(FromString, ToString, Stanza) ->
|
send_stanza(FromString, ToString, Stanza) ->
|
||||||
try
|
try
|
||||||
#xmlel{} = El = fxml_stream:parse_element(Stanza),
|
#xmlel{} = El = fxml_stream:parse_element(Stanza),
|
||||||
|
Loading…
Reference in New Issue
Block a user