aboutsummaryrefslogtreecommitdiff
path: root/src/mod_privacy_mnesia.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mod_privacy_mnesia.erl')
-rw-r--r--src/mod_privacy_mnesia.erl24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/mod_privacy_mnesia.erl b/src/mod_privacy_mnesia.erl
index 4026b7f64..1a9172b5a 100644
--- a/src/mod_privacy_mnesia.erl
+++ b/src/mod_privacy_mnesia.erl
@@ -35,11 +35,7 @@ process_lists_get(LUser, LServer) ->
{'EXIT', _Reason} -> error;
[] -> {none, []};
[#privacy{default = Default, lists = Lists}] ->
- LItems = lists:map(fun ({N, _}) ->
- #xmlel{name = <<"list">>,
- attrs = [{<<"name">>, N}],
- children = []}
- end, Lists),
+ LItems = lists:map(fun ({N, _}) -> N end, Lists),
{Default, LItems}
end.
@@ -54,7 +50,15 @@ process_list_get(LUser, LServer, Name) ->
end
end.
-process_default_set(LUser, LServer, {value, Name}) ->
+process_default_set(LUser, LServer, none) ->
+ F = fun () ->
+ case mnesia:read({privacy, {LUser, LServer}}) of
+ [] -> ok;
+ [R] -> mnesia:write(R#privacy{default = none})
+ end
+ end,
+ mnesia:transaction(F);
+process_default_set(LUser, LServer, Name) ->
F = fun () ->
case mnesia:read({privacy, {LUser, LServer}}) of
[] -> not_found;
@@ -68,14 +72,6 @@ process_default_set(LUser, LServer, {value, Name}) ->
end
end
end,
- mnesia:transaction(F);
-process_default_set(LUser, LServer, false) ->
- F = fun () ->
- case mnesia:read({privacy, {LUser, LServer}}) of
- [] -> ok;
- [R] -> mnesia:write(R#privacy{default = none})
- end
- end,
mnesia:transaction(F).
process_active_set(LUser, LServer, Name) ->