clean subscriptions handling and avoid function_clause

This commit is contained in:
Christophe Romain 2013-08-27 14:23:52 +02:00
parent 1b8876bf55
commit 63b2d21b13
3 changed files with 6 additions and 11 deletions

View File

@ -1302,7 +1302,8 @@ remove_user(User, Server) ->
[NodeId, [NodeId,
Entity, Entity,
JID, JID,
all]) all]);
(_) -> ok
end, end,
Subscriptions), Subscriptions),
{result, Affiliations} = {result, Affiliations} =

View File

@ -952,7 +952,8 @@ remove_user(User, Server) ->
[NodeId, [NodeId,
Entity, Entity,
JID, JID,
all]) all]);
(_) -> ok
end, end,
Subscriptions), Subscriptions),
{result, Affiliations} = {result, Affiliations} =

View File

@ -788,15 +788,8 @@ get_entity_subscriptions(Host, Owner) ->
case decode_subscriptions(S) of case decode_subscriptions(S) of
[] -> [{Node, none, Jid} | Acc]; [] -> [{Node, none, Jid} | Acc];
Subs -> Subs ->
lists:foldl(fun ({Sub, SubId}, lists:foldl(fun ({Sub, SubId}, Acc2) ->
Acc2) -> [{Node, Sub, SubId, Jid} | Acc2]
[{Node, Sub,
SubId, Jid}
| Acc2];
(Sub, Acc2) ->
[{Node, Sub,
Jid}
| Acc2]
end, end,
Acc, Subs) Acc, Subs)
end end