From 9f3cdad3f7e4dce718317281c7d9223c8cab98ed Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Wed, 27 Oct 2010 21:05:19 +1000 Subject: [PATCH] Do not add "jabber:x:delay" more than once --- src/ejabberd_c2s.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index ca94a5245..1fc0c5d92 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -1926,7 +1926,8 @@ process_presence_probe(From, To, StateData) -> end, Timestamp = StateData#state.pres_timestamp, Packet1 = xml:append_subtags( - Packet, + xml:remove_subtags( + Packet, "x", {"xmlns", ?NS_DELAY91}), %% To is the one sending the presence (the target of the probe) [jlib:timestamp_to_xml(Timestamp, utc, To, ""), %% TODO: Delete the next line once XEP-0091 is Obsolete @@ -2855,7 +2856,9 @@ enqueue(StateData, From, To, Packet) -> StateData#state{pres_queue = NewQueue} end; true -> - CleanPacket = xml:remove_subtags(Packet, "x", {"xmlns", ?NS_P1_PUSHED}), + CleanPacket = xml:remove_subtags( + xml:remove_subtags(Packet, "x", {"xmlns", ?NS_P1_PUSHED}), + "x", {"xmlns", ?NS_DELAY91}), Packet2 = case CleanPacket of {xmlelement, "message" = Name, Attrs, Els} ->