]> granicus.if.org Git - ejabberd/commitdiff
Fix PubSub RSM on get_items (#1147)
authorChristophe Romain <christophe.romain@process-one.net>
Wed, 22 Jun 2016 10:25:41 +0000 (12:25 +0200)
committerChristophe Romain <christophe.romain@process-one.net>
Wed, 22 Jun 2016 10:25:41 +0000 (12:25 +0200)
src/node_flat_sql.erl

index 7b8ee552c38cabac718aadc361a7debbae642b3b..0869f531c818a71bc707ec8ae86ca76a5576d09f 100644 (file)
@@ -686,13 +686,10 @@ get_items(Nidx, _From,
            #rsm_in{max = M, direction = Direction, id = I, index = IncIndex}) ->
     Max = ejabberd_sql:escape(jlib:i2l(M)),
     {Way, Order} = case Direction of
-       %     aft -> {<<"<">>, <<"desc">>};
-       %     before when I == <<>> -> {<<"is not">>, <<"asc">>};
-       %     before -> {<<">">>, <<"asc">>};
-       %     _ when IncIndex =/= undefined ->
-       %         {<<"<">>, <<"desc">>}; % using index
-       _ ->
-           {<<"is not">>, <<"desc">>}% Can be better
+            aft when I == <<>> -> {<<"is not">>, <<"desc">>};
+            aft -> {<<"<">>, <<"desc">>};
+            before when I == <<>> -> {<<"is not">>, <<"asc">>};
+            before -> {<<">">>, <<"asc">>}
     end,
     SNidx = integer_to_binary(Nidx),
     [AttrName, Id] = case I of