25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

avoid resending <stream:error> stanzas on terminate (EJAB-1180)

SVN Revision: 2957
This commit is contained in:
Evgeniy Khramtsov 2010-02-03 12:10:08 +00:00
parent 7d7177a6af
commit ad1aec6cd1

View File

@ -434,11 +434,16 @@ resend_messages(Messages) ->
%% This function is used to resend messages that have been polled but not %% This function is used to resend messages that have been polled but not
%% delivered. %% delivered.
resend_message(Packet) -> resend_message(Packet) ->
[ParsedPacket] = exmpp_xml:parse_document(Packet, ?PARSER_OPTIONS), [#xmlel{name = Name} = ParsedPacket] =
exmpp_xml:parse_document(Packet, ?PARSER_OPTIONS),
if Name == iq; Name == message; Name == presence ->
From = get_jid("from", ParsedPacket), From = get_jid("from", ParsedPacket),
To = get_jid("to", ParsedPacket), To = get_jid("to", ParsedPacket),
?DEBUG("Resend ~p ~p ~p~n",[From,To, ParsedPacket]), ?DEBUG("Resend ~p ~p ~p~n",[From,To, ParsedPacket]),
ejabberd_router:route(From, To, ParsedPacket). ejabberd_router:route(From, To, ParsedPacket);
true ->
ok
end.
%% Type can be "from" or "to" %% Type can be "from" or "to"
%% Parsed packet is a parsed Jabber packet. %% Parsed packet is a parsed Jabber packet.