Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2018-03-17 12:55:14 +0300
committerChristophe Romain <christophe.romain@process-one.net>2018-03-17 12:59:34 +0300
commit7ba6fae67cd3ba845e9d07dbc562d49fe108550d (patch)
tree969041ce3da54b75196c8c6547d5c81078326ebb
parent7beb19b01e7e3edc1be69a6901a1ff9a0fef79a2 (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
-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 eb5ee8ccb..666ea41ee 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) ->