From 4a9e7f0a3ac3288a87d3f0c5e52af91a20af3514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20R=C3=A9mond?= Date: Tue, 4 Jan 2011 11:18:14 +0000 Subject: [PATCH] Use route instead of send_element to go through standard workflow Offline messages should thus be tracked for ack if needed (TEXTO-226). Signed-off-by: Evgeniy Khramtsov --- src/ejabberd_c2s.erl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 600f6fa20..ec8509fed 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -1572,7 +1572,7 @@ change_shaper(StateData, JID) -> send_text(StateData, Text) when StateData#state.xml_socket -> ?DEBUG("Send Text on stream = ~p", [lists:flatten(Text)]), - (StateData#state.sockmod):send_xml(StateData#state.socket, + (StateData#state.sockmod):send_xml(StateData#state.socket, {xmlstreamraw, Text}); send_text(StateData, Text) -> ?DEBUG("Send XML on stream = ~p", [Text]), @@ -2169,11 +2169,13 @@ resend_offline_messages(StateData) -> jlib:jid_to_string(To), Attrs), FixedPacket = {xmlelement, Name, Attrs2, Els}, - send_element(StateData, FixedPacket), - ejabberd_hooks:run(user_receive_packet, - StateData#state.server, - [StateData#state.debug, StateData#state.jid, - From, To, FixedPacket]); + %% Use route instead of send_element to go through standard workflow + ejabberd_router:route(From, To, Packet); + %% send_element(StateData, FixedPacket), + %% ejabberd_hooks:run(user_receive_packet, + %% StateData#state.server, + %% [StateData#state.jid, + %% From, To, FixedPacket]); true -> ok end