From: Badlop Date: Sat, 21 Feb 2009 09:15:43 +0000 (+0000) Subject: Merge r1822 and partial r1834 from trunk: X-Git-Tag: v2.0.5~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd29a77759b4619042d4fa606e9e26cb5330c10f;p=ejabberd Merge r1822 and partial r1834 from trunk: * src/mod_privacy.erl: Privacy list items must be processed in the specified order (EJAB-848) * src/mod_privacy_odbc.erl: Likewise SVN Revision: 1895 --- diff --git a/ChangeLog b/ChangeLog index b2a1c43bf..9bbd71316 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-02-21 Badlop + * src/mod_privacy.erl: Privacy list items must be processed in the + specified order (EJAB-848) + * src/mod_privacy_odbc.erl: Likewise + * src/ejabberd_c2s.erl: Ensure unique ID in roster push (EJAB-721) * src/mod_roster.erl: Likewise * src/mod_roster_odbc.erl: Likewise diff --git a/src/mod_privacy.erl b/src/mod_privacy.erl index a9da69090..3d4af74ff 100644 --- a/src/mod_privacy.erl +++ b/src/mod_privacy.erl @@ -414,7 +414,8 @@ parse_items(Els) -> parse_items(Els, []). parse_items([], Res) -> - lists:reverse(Res); + %% Sort the items by their 'order' attribute + lists:keysort(#listitem.order, Res); parse_items([{xmlelement, "item", Attrs, SubEls} | Els], Res) -> Type = xml:get_attr("type", Attrs), Value = xml:get_attr("value", Attrs), diff --git a/src/mod_privacy_odbc.erl b/src/mod_privacy_odbc.erl index 6f7aa4871..b559fb539 100644 --- a/src/mod_privacy_odbc.erl +++ b/src/mod_privacy_odbc.erl @@ -414,7 +414,8 @@ parse_items(Els) -> parse_items(Els, []). parse_items([], Res) -> - lists:reverse(Res); + %% Sort the items by their 'order' attribute + lists:keysort(#listitem.order, Res); parse_items([{xmlelement, "item", Attrs, SubEls} | Els], Res) -> Type = xml:get_attr("type", Attrs), Value = xml:get_attr("value", Attrs),