From 63b2d21b1307e5ec547f08fb21b257baeeb13792 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Tue, 27 Aug 2013 14:23:52 +0200 Subject: [PATCH] clean subscriptions handling and avoid function_clause --- src/mod_pubsub.erl | 3 ++- src/mod_pubsub_odbc.erl | 3 ++- src/node_hometree_odbc.erl | 11 ++--------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/mod_pubsub.erl b/src/mod_pubsub.erl index 573fbb835..5885a604f 100644 --- a/src/mod_pubsub.erl +++ b/src/mod_pubsub.erl @@ -1302,7 +1302,8 @@ remove_user(User, Server) -> [NodeId, Entity, JID, - all]) + all]); + (_) -> ok end, Subscriptions), {result, Affiliations} = diff --git a/src/mod_pubsub_odbc.erl b/src/mod_pubsub_odbc.erl index 08ae9fe45..1a182e4d6 100644 --- a/src/mod_pubsub_odbc.erl +++ b/src/mod_pubsub_odbc.erl @@ -952,7 +952,8 @@ remove_user(User, Server) -> [NodeId, Entity, JID, - all]) + all]); + (_) -> ok end, Subscriptions), {result, Affiliations} = diff --git a/src/node_hometree_odbc.erl b/src/node_hometree_odbc.erl index 090fae513..a98e56dcf 100644 --- a/src/node_hometree_odbc.erl +++ b/src/node_hometree_odbc.erl @@ -788,15 +788,8 @@ get_entity_subscriptions(Host, Owner) -> case decode_subscriptions(S) of [] -> [{Node, none, Jid} | Acc]; Subs -> - lists:foldl(fun ({Sub, SubId}, - Acc2) -> - [{Node, Sub, - SubId, Jid} - | Acc2]; - (Sub, Acc2) -> - [{Node, Sub, - Jid} - | Acc2] + lists:foldl(fun ({Sub, SubId}, Acc2) -> + [{Node, Sub, SubId, Jid} | Acc2] end, Acc, Subs) end