summaryrefslogtreecommitdiff
path: root/src/mod_pubsub.erl
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2018-03-17 10:55:14 +0100
committerChristophe Romain <christophe.romain@process-one.net>2018-03-17 10:59:34 +0100
commit7ba6fae67cd3ba845e9d07dbc562d49fe108550d (patch)
tree969041ce3da54b75196c8c6547d5c81078326ebb /src/mod_pubsub.erl
parentFix result of XEP-0060 §6.5.9.12 (#2288) (diff)
Improve result of XEP-0060 §6.5.9.12 (#2288)
Moving get_item result control to keep item-not-found on transaction error when node does not exists
Diffstat (limited to 'src/mod_pubsub.erl')
-rw-r--r--src/mod_pubsub.erl14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl
index eb5ee8cc..666ea41e 100644
--- a/src/mod_pubsub.erl
+++ b/src/mod_pubsub.erl
@@ -1999,8 +1999,12 @@ get_items(Host, Node, From, SubId, _MaxItems, ItemIds, RSM) ->
Host, From, Owners, AccessModel, AllowedGroups),
case ItemIds of
[ItemId] ->
- node_call(Host, Type, get_item,
- [Nidx, ItemId, From, AccessModel, PS, RG, undefined]);
+ case node_call(Host, Type, get_item,
+ [Nidx, ItemId, From, AccessModel, PS, RG, undefined])
+ of
+ {error, _} -> {result, {[], undefined}};
+ Result -> Result
+ end;
_ ->
node_call(Host, Type, get_items,
[Nidx, From, AccessModel, PS, RG, SubId, RSM])
@@ -2026,10 +2030,8 @@ get_items(Host, Node, From, SubId, _MaxItems, ItemIds, RSM) ->
{result,
#pubsub{items = #ps_items{node = Node,
items = itemsEls([Item])}}};
- _ ->
- {result,
- #pubsub{items = #ps_items{node = Node,
- items = itemsEls([])}}}
+ Error ->
+ Error
end.
get_items(Host, Node) ->