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-22 13:59:24 +0300
committerChristophe Romain <christophe.romain@process-one.net>2018-03-22 13:59:24 +0300
commit0bda169a5acec2ff0472d18235cafa36b7b99b28 (patch)
tree65847c3a50f91c494a0ce5ec57c667d8b9856a8e
parent96c183c04b46d3f2dee352c4ff494609c95e2cfc (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,