25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00
This commit is contained in:
Christophe Romain 2011-03-18 17:41:56 +01:00
parent 75d2cbcb14
commit f05a4d1638
2 changed files with 2 additions and 2 deletions

View File

@ -25,7 +25,7 @@ purge() ->
I=element(3,N), I=element(3,N),
lists:foreach(fun(JID) -> lists:foreach(fun(JID) ->
case mnesia:dirty_read({pubsub_state, {JID, I}}) of case mnesia:dirty_read({pubsub_state, {JID, I}}) of
[{pubsub_state, K, _, _, [{subscribed,S}]}] -> mnesia:dirty_delete({pubsub_subscription, S}); [{pubsub_state, K, _, _, _, [{subscribed,S}]}] -> mnesia:dirty_delete({pubsub_subscription, S});
_ -> ok _ -> ok
end, end,
mnesia:dirty_delete({pubsub_state, {JID, I}}) mnesia:dirty_delete({pubsub_state, {JID, I}})

View File

@ -33,7 +33,7 @@ item(ItemId, NodeId) ->
[I] -> I; [I] -> I;
_ -> undefined _ -> undefined
end. end.
items(NodeId) -> mnesia:dirty_index_read(pubsub_item, NodeIdi, #pubsub_item.nodeidx). items(NodeId) -> mnesia:dirty_index_read(pubsub_item, NodeId, #pubsub_item.nodeidx).
itemid(I) -> element(1, I#pubsub_item.itemid). itemid(I) -> element(1, I#pubsub_item.itemid).
itemids(NodeId) -> [itemid(I) || I <- items(NodeId)]. itemids(NodeId) -> [itemid(I) || I <- items(NodeId)].
items_by_id(ItemId) -> mnesia:dirty_match_object(#pubsub_item{itemid={ItemId, '_'}, _='_'}). items_by_id(ItemId) -> mnesia:dirty_match_object(#pubsub_item{itemid={ItemId, '_'}, _='_'}).