From bbe5c6b74eaf9b9b3ba35f717c40617e11b225b7 Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sun, 10 Nov 2013 00:56:28 +1000 Subject: Do not fail on badly formed SQL results --- src/mod_blocking.erl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mod_blocking.erl') diff --git a/src/mod_blocking.erl b/src/mod_blocking.erl index 9eba5c950..27d727a14 100644 --- a/src/mod_blocking.erl +++ b/src/mod_blocking.erl @@ -236,7 +236,7 @@ process_blocklist_block(LUser, LServer, Filter, odbc) -> <<"match_all">>, <<"match_iq">>, <<"match_message">>, <<"match_presence_in">>, <<"match_presence_out">>], RItems = [_ | _]} -> - List = lists:map(fun mod_privacy:raw_to_item/1, RItems); + List = lists:flatmap(fun mod_privacy:raw_to_item/1, RItems); _ -> List = [] end, NewList = Filter(List), @@ -432,8 +432,8 @@ process_blocklist_unblock(LUser, LServer, Filter, <<"match_all">>, <<"match_iq">>, <<"match_message">>, <<"match_presence_in">>, <<"match_presence_out">>], RItems = [_ | _]} -> - List = lists:map(fun mod_privacy:raw_to_item/1, - RItems), + List = lists:flatmap(fun mod_privacy:raw_to_item/1, + RItems), NewList = Filter(List), NewRItems = lists:map(fun mod_privacy:item_to_raw/1, NewList), @@ -521,7 +521,7 @@ process_blocklist_get(LUser, LServer, odbc) -> <<"match_all">>, <<"match_iq">>, <<"match_message">>, <<"match_presence_in">>, <<"match_presence_out">>], RItems} -> - lists:map(fun mod_privacy:raw_to_item/1, RItems); + lists:flatmap(fun mod_privacy:raw_to_item/1, RItems); {'EXIT', _} -> error end; {'EXIT', _} -> error -- cgit v1.2.3