diff options
author | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-12-28 14:01:39 +0300 |
---|---|---|
committer | Evgeniy Khramtsov <ekhramtsov@process-one.net> | 2017-12-28 14:01:39 +0300 |
commit | e03d41647b5decf7083fcaa09220087ea94c6891 (patch) | |
tree | 871c301680266845f58eb5cf2a1e64bdb91c8104 | |
parent | Return send() result to the caller (diff) | |
parent | Don't force rsm when max_items is not defined (#2189) (diff) |
Merge branch 'master' of github.com:processone/ejabberd
-rw-r--r-- | src/node_flat.erl | 9 | ||||
-rw-r--r-- | src/node_flat_sql.erl | 9 |
2 files changed, 2 insertions, 16 deletions
diff --git a/src/node_flat.erl b/src/node_flat.erl index 9de64d1a1..189950368 100644 --- a/src/node_flat.erl +++ b/src/node_flat.erl @@ -734,14 +734,7 @@ del_state(#pubsub_state{stateid = {Key, Nidx}, items = Items}) -> get_items(Nidx, _From, undefined) -> RItems = lists:keysort(#pubsub_item.creation, mnesia:index_read(pubsub_item, Nidx, #pubsub_item.nodeidx)), - Count = length(RItems), - if Count =< ?MAXITEMS -> - {result, {RItems, undefined}}; - true -> - ItemsPage = lists:sublist(RItems, ?MAXITEMS), - Rsm = rsm_page(Count, 0, 0, ItemsPage), - {result, {ItemsPage, Rsm}} - end; + {result, {RItems, undefined}}; get_items(Nidx, _From, #rsm_set{max = Max, index = IncIndex, 'after' = After, before = Before}) -> diff --git a/src/node_flat_sql.erl b/src/node_flat_sql.erl index 2773114a2..c48a1a636 100644 --- a/src/node_flat_sql.erl +++ b/src/node_flat_sql.erl @@ -655,14 +655,7 @@ get_items(Nidx, _From, undefined) -> " from pubsub_item where nodeid='", SNidx/binary, "'", " order by creation asc">>]) of {selected, _, AllItems} -> - Count = length(AllItems), - if Count =< ?MAXITEMS -> - {result, {[raw_to_item(Nidx, RItem) || RItem <- AllItems], undefined}}; - true -> - RItems = lists:sublist(AllItems, ?MAXITEMS), - Rsm = rsm_page(Count, 0, 0, RItems), - {result, {[raw_to_item(Nidx, RItem) || RItem <- RItems], Rsm}} - end; + {result, {[raw_to_item(Nidx, RItem) || RItem <- AllItems], undefined}}; _ -> {result, {[], undefined}} end; |