Use mod_private:del_data in unban_account command

This commit is contained in:
Pawel Chmielowski
2025-10-14 13:17:28 +02:00
parent f666cd4643
commit ef94ee66fd
2 changed files with 4 additions and 7 deletions
+3 -6
View File
@@ -290,7 +290,7 @@ get_commands_spec() ->
note = "added in 24.06",
args = [{user, binary}, {host, binary}],
args_example = [<<"attacker">>, <<"myserver.com">>],
args_desc = ["User name to unban", "Server name"],
args_desc = ["Name of a user to check ban information", "Server name"],
result = {ban_details, {list,
{detail, {tuple, [{name, string},
{value, string}
@@ -1288,11 +1288,8 @@ unban_account(User, Host) ->
end.
unban_account2(User, Host) ->
UnBanPrivateXml = build_unban_xmlel(),
private_set2(User, Host, UnBanPrivateXml).
build_unban_xmlel() ->
#xmlel{name = <<"banned">>, attrs = [{<<"xmlns">>, <<"jabber:ejabberd:banned">>}]}.
mod_private:del_data(jid:nodeprep(User), jid:nameprep(Host), <<"jabber:ejabberd:banned">>),
ok.
%%%
%%% Sessions
+1 -1
View File
@@ -284,7 +284,7 @@ del_data(LUser, LServer, NS) ->
ok ->
case use_cache(Mod, LServer) of
true ->
delete_cache(Mod, LUser, LServer, {NS, #xmlel{}});
delete_cache(Mod, LUser, LServer, [{NS, #xmlel{}}]);
_ ->
ok
end;