]> granicus.if.org Git - ejabberd/commitdiff
Merge r1822 and partial r1834 from trunk:
authorBadlop <badlop@process-one.net>
Sat, 21 Feb 2009 09:15:43 +0000 (09:15 +0000)
committerBadlop <badlop@process-one.net>
Sat, 21 Feb 2009 09:15:43 +0000 (09:15 +0000)
* 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

ChangeLog
src/mod_privacy.erl
src/mod_privacy_odbc.erl

index b2a1c43bf0ca410de293593c5d608dfff1d0f62d..9bbd71316761096d651a907f22742ffd0140f555 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-02-21  Badlop  <badlop@process-one.net>
 
+       * 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
index a9da69090eccf7a8003877e9a531180fb05a113e..3d4af74ffbd0c955becc9903cd0595616db0e346 100644 (file)
@@ -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),
index 6f7aa4871b10ebb6f08a10c1eeedef997c67d8e3..b559fb539a6788acf7195aea4ae4710ddc756927 100644 (file)
@@ -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),