diff --git a/rebar.config b/rebar.config index 0bed2299e..6120535ed 100644 --- a/rebar.config +++ b/rebar.config @@ -24,8 +24,8 @@ {cache_tab, ".*", {git, "https://github.com/processone/cache_tab", {tag, "1.0.12"}}}, {fast_tls, ".*", {git, "https://github.com/processone/fast_tls", {tag, "1.0.20"}}}, {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.10"}}}, - {fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.28"}}}, - {xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "1.1.19"}}}, + {fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "dbf173f"}}}, + {xmpp, ".*", {git, "https://github.com/processone/xmpp", {tag, "cd4aacf"}}}, {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.12"}}}, {jiffy, ".*", {git, "https://github.com/davisp/jiffy", {tag, "0.14.8"}}}, {p1_oauth2, ".*", {git, "https://github.com/processone/p1_oauth2", {tag, "0.6.2"}}}, diff --git a/src/ejabberd_piefxis.erl b/src/ejabberd_piefxis.erl index b219d923f..c73c8b3a4 100644 --- a/src/ejabberd_piefxis.erl +++ b/src/ejabberd_piefxis.erl @@ -277,7 +277,7 @@ get_roster(User, Server) -> get_private(User, Server) -> case mod_private:get_data(User, Server) of [_|_] = Els -> - [xmpp:encode(#private{xml_els = Els})]; + [xmpp:encode(#private{sub_els = Els})]; _ -> [] end. diff --git a/src/mod_admin_extra.erl b/src/mod_admin_extra.erl index e64cdb465..a0679aefe 100644 --- a/src/mod_admin_extra.erl +++ b/src/mod_admin_extra.erl @@ -1461,7 +1461,7 @@ private_get(Username, Host, Element, Ns) -> ElementXml = #xmlel{name = Element, attrs = [{<<"xmlns">>, Ns}]}, Els = mod_private:get_data(jid:nodeprep(Username), jid:nameprep(Host), [{Ns, ElementXml}]), - binary_to_list(fxml:element_to_binary(xmpp:encode(#private{xml_els = Els}))). + binary_to_list(fxml:element_to_binary(xmpp:encode(#private{sub_els = Els}))). private_set(Username, Host, ElementString) -> case fxml_stream:parse_element(ElementString) of diff --git a/src/mod_carboncopy.erl b/src/mod_carboncopy.erl index 8e76ad1d2..9c5f5ffd5 100644 --- a/src/mod_carboncopy.erl +++ b/src/mod_carboncopy.erl @@ -247,7 +247,7 @@ send_copies(JID, To, Packet, Direction)-> -spec build_forward_packet(jid(), message(), jid(), jid(), direction()) -> message(). build_forward_packet(JID, #message{type = T} = Msg, Sender, Dest, Direction) -> - Forwarded = #forwarded{xml_els = [xmpp:encode(complete_packet(JID, Msg, Direction))]}, + Forwarded = #forwarded{sub_els = [complete_packet(JID, Msg, Direction)]}, Carbon = case Direction of sent -> #carbons_sent{forwarded = Forwarded}; received -> #carbons_received{forwarded = Forwarded} diff --git a/src/mod_delegation.erl b/src/mod_delegation.erl index 1d34be12e..350a2db37 100644 --- a/src/mod_delegation.erl +++ b/src/mod_delegation.erl @@ -242,7 +242,7 @@ process_iq(#iq{to = To, lang = Lang, sub_els = [SubEl]} = IQ, Type) -> case dict:find({NS, Type}, Delegations) of {ok, {Host, _}} -> Delegation = #delegation{ - forwarded = #forwarded{xml_els = [xmpp:encode(IQ)]}}, + forwarded = #forwarded{sub_els = [IQ]}}, NewFrom = jid:make(LServer), NewTo = jid:make(Host), ejabberd_router:route_iq( @@ -261,7 +261,7 @@ process_iq(#iq{to = To, lang = Lang, sub_els = [SubEl]} = IQ, Type) -> process_iq_result(#iq{from = From, to = To, id = ID, lang = Lang} = IQ, #iq{type = result} = ResIQ) -> try - #delegation{forwarded = #forwarded{xml_els = [SubEl]}} = + #delegation{forwarded = #forwarded{sub_els = [SubEl]}} = xmpp:get_subtag(ResIQ, #delegation{}), case xmpp:decode(SubEl, ?NS_CLIENT, [ignore_els]) of #iq{from = To, to = From, type = Type, id = ID} = Reply diff --git a/src/mod_mam.erl b/src/mod_mam.erl index 8f3704923..b6f80be67 100644 --- a/src/mod_mam.erl +++ b/src/mod_mam.erl @@ -924,7 +924,7 @@ msg_to_el(#archive_msg{timestamp = TS, packet = El, nick = Nick, Pkt3 = maybe_update_from_to( Pkt2, JidRequestor, JidArchive, Peer, MsgType, Nick), Delay = #delay{stamp = TS, from = jid:make(LServer)}, - {ok, #forwarded{xml_els = [xmpp:encode(Pkt3)], delay = Delay}} + {ok, #forwarded{sub_els = [Pkt3], delay = Delay}} catch _:{xmpp_codec, Why} -> ?ERROR_MSG("Failed to decode raw element ~p from message " "archive of user ~s: ~s", diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index a82689406..646d0fdd7 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -4102,7 +4102,7 @@ send_subscriptions_change_notifications(From, Nick, Type, State) -> node = ?NS_MUCSUB_NODES_SUBSCRIBERS, items = [#ps_item{ id = randoms:get_string(), - xml_els = [xmpp:encode(Payload)]}]}}]}, + sub_els = [Payload]}]}}]}, ejabberd_router:route(xmpp:set_from_to(Packet, From, JID)); false -> ok @@ -4138,14 +4138,14 @@ send_wrapped(From, To, Packet, Node, State) -> -spec wrap(jid(), jid(), stanza(), binary()) -> message(). wrap(From, To, Packet, Node) -> - El = xmpp:encode(xmpp:set_from_to(Packet, From, To)), + El = xmpp:set_from_to(Packet, From, To), #message{ sub_els = [#ps_event{ items = #ps_items{ node = Node, items = [#ps_item{ id = randoms:get_string(), - xml_els = [El]}]}}]}. + sub_els = [El]}]}}]}. %% -spec send_multiple(jid(), binary(), [#user{}], stanza()) -> ok. %% send_multiple(From, Server, Users, Packet) -> diff --git a/src/mod_private.erl b/src/mod_private.erl index f819f2b60..f5000ed9c 100644 --- a/src/mod_private.erl +++ b/src/mod_private.erl @@ -91,7 +91,7 @@ reload(Host, NewOpts, OldOpts) -> process_sm_iq(#iq{type = Type, lang = Lang, from = #jid{luser = LUser, lserver = LServer}, to = #jid{luser = LUser, lserver = LServer}, - sub_els = [#private{xml_els = Els0}]} = IQ) -> + sub_els = [#private{sub_els = Els0}]} = IQ) -> case filter_xmlels(Els0) of [] -> Txt = <<"No private data found in this query">>, @@ -112,7 +112,7 @@ process_sm_iq(#iq{type = Type, lang = Lang, Err = xmpp:err_internal_server_error(Txt, Lang), xmpp:make_error(IQ, Err); Els -> - xmpp:make_iq_result(IQ, #private{xml_els = Els}) + xmpp:make_iq_result(IQ, #private{sub_els = Els}) end end; process_sm_iq(#iq{lang = Lang} = IQ) -> diff --git a/src/mod_privilege.erl b/src/mod_privilege.erl index e201338f3..994b57e01 100644 --- a/src/mod_privilege.erl +++ b/src/mod_privilege.erl @@ -277,7 +277,7 @@ forward_message(#message{to = To} = Msg) -> ServerHost = To#jid.lserver, Lang = xmpp:get_lang(Msg), try xmpp:try_subtag(Msg, #privilege{}) of - #privilege{forwarded = #forwarded{xml_els = [SubEl]}} -> + #privilege{forwarded = #forwarded{sub_els = [SubEl]}} -> try xmpp:decode(SubEl, ?NS_CLIENT, [ignore_els]) of #message{} = NewMsg -> case NewMsg#message.from of diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 40a326357..465d15a26 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -1113,7 +1113,7 @@ iq_pubsub(Host, Access, #iq{from = From, type = IQType, lang = Lang, publish_options = XData, configure = _, _ = undefined}} -> ServerHost = serverhost(Host), case Items of - [#ps_item{id = ItemId, xml_els = Payload}] -> + [#ps_item{id = ItemId, sub_els = Payload}] -> case decode_publish_options(XData, Lang) of {error, _} = Err -> Err; @@ -2659,7 +2659,7 @@ broadcast_publish_item(Host, Node, Nidx, Type, NodeOptions, ItemId, From, Payloa case get_collection_subscriptions(Host, Node) of SubsByDepth when is_list(SubsByDepth) -> EventItem0 = case get_option(NodeOptions, deliver_payloads) of - true -> #ps_item{xml_els = Payload, id = ItemId}; + true -> #ps_item{sub_els = Payload, id = ItemId}; false -> #ps_item{id = ItemId} end, EventItem = case get_option(NodeOptions, itemreply, none) of @@ -3743,7 +3743,7 @@ uniqid() -> -spec itemsEls([#pubsub_item{}]) -> [ps_item()]. itemsEls(Items) -> - [#ps_item{id = ItemId, xml_els = Payload} + [#ps_item{id = ItemId, sub_els = Payload} || #pubsub_item{itemid = {ItemId, _}, payload = Payload} <- Items]. -spec add_message_type(message(), message_type()) -> message(). diff --git a/src/mod_push.erl b/src/mod_push.erl index df63ee6f1..c9f117e1f 100644 --- a/src/mod_push.erl +++ b/src/mod_push.erl @@ -446,7 +446,7 @@ notify(LUser, LServer, Clients) -> fun((iq() | timeout) -> any())) -> ok. notify(LServer, PushLJID, Node, XData, HandleResponse) -> From = jid:make(LServer), - Item = #ps_item{xml_els = [xmpp:encode(#push_notification{})]}, + Item = #ps_item{sub_els = [#push_notification{}]}, PubSub = #pubsub{publish = #ps_publish{node = Node, items = [Item]}, publish_options = XData}, IQ = #iq{type = set, diff --git a/src/mod_service_log.erl b/src/mod_service_log.erl index 783c29188..2f4aa7395 100644 --- a/src/mod_service_log.erl +++ b/src/mod_service_log.erl @@ -72,7 +72,7 @@ log_packet(Packet, Host) -> ForwardedMsg = #message{from = jid:make(Host), id = randoms:get_string(), sub_els = [#forwarded{ - xml_els = [xmpp:encode(Packet)]}]}, + sub_els = [Packet]}]}, lists:foreach( fun(Logger) -> ejabberd_router:route(xmpp:set_to(ForwardedMsg, jid:make(Logger)))