aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2018-03-22 11:59:24 +0100
committerChristophe Romain <christophe.romain@process-one.net>2018-03-22 11:59:24 +0100
commit0bda169a5acec2ff0472d18235cafa36b7b99b28 (patch)
tree65847c3a50f91c494a0ce5ec57c667d8b9856a8e
parentAccept atoms in api_permission command lists and commands with numbers in them (diff)
Remove items of unregistered user (#2129)
-rw-r--r--src/mod_pubsub.erl15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl
index 666ea41ee..fc942ff79 100644
--- a/src/mod_pubsub.erl
+++ b/src/mod_pubsub.erl
@@ -685,12 +685,17 @@ remove_user(User, Server) ->
({#pubsub_node{nodeid = {H, N}, type = Type}, owner})
when N == HomeTreeBase, Type == <<"hometree">> ->
delete_node(H, N, Entity);
- ({#pubsub_node{id = Nidx}, publisher}) ->
+ ({#pubsub_node{id = Nidx}, _}) ->
+ {result, State} = node_action(Host, PType,
+ get_state,
+ [Nidx, jid:tolower(Entity)]),
+ ItemIds = State#pubsub_state.items,
node_action(Host, PType,
- set_affiliation,
- [Nidx, Entity, none]);
- (_) ->
- ok
+ remove_extra_items,
+ [Nidx, 0, ItemIds]),
+ node_action(Host, PType,
+ set_affiliation,
+ [Nidx, Entity, none])
end,
Affs)
end,