25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Add mam and offline tags to the related purge commands

This commit is contained in:
Badlop 2024-09-11 18:37:49 +02:00
parent 512285e48d
commit d9ddbe0212
2 changed files with 11 additions and 10 deletions

View File

@ -370,17 +370,17 @@ get_commands_spec() ->
args = [{out, string}], args = [{out, string}],
result = {res, rescode}}, result = {res, rescode}},
#ejabberd_commands{name = delete_expired_messages, tags = [purge], #ejabberd_commands{name = delete_expired_messages, tags = [offline, purge],
desc = "Delete expired offline messages from database", desc = "Delete expired offline messages from database",
module = ?MODULE, function = delete_expired_messages, module = ?MODULE, function = delete_expired_messages,
args = [], result = {res, rescode}}, args = [], result = {res, rescode}},
#ejabberd_commands{name = delete_old_messages, tags = [purge], #ejabberd_commands{name = delete_old_messages, tags = [offline, purge],
desc = "Delete offline messages older than DAYS", desc = "Delete offline messages older than DAYS",
module = ?MODULE, function = delete_old_messages, module = ?MODULE, function = delete_old_messages,
args_desc = ["Number of days"], args_desc = ["Number of days"],
args_example = [31], args_example = [31],
args = [{days, integer}], result = {res, rescode}}, args = [{days, integer}], result = {res, rescode}},
#ejabberd_commands{name = delete_old_messages_batch, tags = [purge], #ejabberd_commands{name = delete_old_messages_batch, tags = [offline, purge],
desc = "Delete offline messages older than DAYS", desc = "Delete offline messages older than DAYS",
note = "added in 22.05", note = "added in 22.05",
module = ?MODULE, function = delete_old_messages_batch, module = ?MODULE, function = delete_old_messages_batch,
@ -393,7 +393,7 @@ get_commands_spec() ->
result = {res, restuple}, result = {res, restuple},
result_desc = "Result tuple", result_desc = "Result tuple",
result_example = {ok, <<"Removal of 5000 messages in progress">>}}, result_example = {ok, <<"Removal of 5000 messages in progress">>}},
#ejabberd_commands{name = delete_old_messages_status, tags = [purge], #ejabberd_commands{name = delete_old_messages_status, tags = [offline, purge],
desc = "Status of delete old offline messages operation", desc = "Status of delete old offline messages operation",
note = "added in 22.05", note = "added in 22.05",
module = ?MODULE, function = delete_old_messages_status, module = ?MODULE, function = delete_old_messages_status,
@ -403,7 +403,7 @@ get_commands_spec() ->
result = {status, string}, result = {status, string},
result_desc = "Status test", result_desc = "Status test",
result_example = "Operation in progress, delete 5000 messages"}, result_example = "Operation in progress, delete 5000 messages"},
#ejabberd_commands{name = abort_delete_old_messages, tags = [purge], #ejabberd_commands{name = abort_delete_old_messages, tags = [offline, purge],
desc = "Abort currently running delete old offline messages operation", desc = "Abort currently running delete old offline messages operation",
note = "added in 22.05", note = "added in 22.05",
module = ?MODULE, function = delete_old_messages_abort, module = ?MODULE, function = delete_old_messages_abort,
@ -528,7 +528,7 @@ get_commands_spec() ->
module = ejabberd_doc, function = man, module = ejabberd_doc, function = man,
args = [], result = {res, restuple}}, args = [], result = {res, restuple}},
#ejabberd_commands{name = webadmin_host_user_queue, tags = [internal], #ejabberd_commands{name = webadmin_host_user_queue, tags = [offline, internal],
desc = "Generate WebAdmin offline queue HTML", desc = "Generate WebAdmin offline queue HTML",
module = mod_offline, function = webadmin_host_user_queue, module = mod_offline, function = webadmin_host_user_queue,
args = [{user, binary}, {host, binary}, {query, any}, {lang, binary}], args = [{user, binary}, {host, binary}, {query, any}, {lang, binary}],

View File

@ -1487,7 +1487,8 @@ get_jids(Js) ->
[jid:tolower(jid:remove_resource(J)) || J <- Js]. [jid:tolower(jid:remove_resource(J)) || J <- Js].
get_commands_spec() -> get_commands_spec() ->
[#ejabberd_commands{name = delete_old_mam_messages, tags = [purge], [
#ejabberd_commands{name = delete_old_mam_messages, tags = [mam, purge],
desc = "Delete MAM messages older than DAYS", desc = "Delete MAM messages older than DAYS",
longdesc = "Valid message TYPEs: " longdesc = "Valid message TYPEs: "
"`chat`, `groupchat`, `all`.", "`chat`, `groupchat`, `all`.",
@ -1497,7 +1498,7 @@ get_commands_spec() ->
args_example = [<<"all">>, 31], args_example = [<<"all">>, 31],
args = [{type, binary}, {days, integer}], args = [{type, binary}, {days, integer}],
result = {res, rescode}}, result = {res, rescode}},
#ejabberd_commands{name = delete_old_mam_messages_batch, tags = [purge], #ejabberd_commands{name = delete_old_mam_messages_batch, tags = [mam, purge],
desc = "Delete MAM messages older than DAYS", desc = "Delete MAM messages older than DAYS",
note = "added in 22.05", note = "added in 22.05",
longdesc = "Valid message TYPEs: " longdesc = "Valid message TYPEs: "
@ -1513,7 +1514,7 @@ get_commands_spec() ->
result = {res, restuple}, result = {res, restuple},
result_desc = "Result tuple", result_desc = "Result tuple",
result_example = {ok, <<"Removal of 5000 messages in progress">>}}, result_example = {ok, <<"Removal of 5000 messages in progress">>}},
#ejabberd_commands{name = delete_old_mam_messages_status, tags = [purge], #ejabberd_commands{name = delete_old_mam_messages_status, tags = [mam, purge],
desc = "Status of delete old MAM messages operation", desc = "Status of delete old MAM messages operation",
note = "added in 22.05", note = "added in 22.05",
module = ?MODULE, function = delete_old_messages_status, module = ?MODULE, function = delete_old_messages_status,
@ -1523,7 +1524,7 @@ get_commands_spec() ->
result = {status, string}, result = {status, string},
result_desc = "Status test", result_desc = "Status test",
result_example = "Operation in progress, delete 5000 messages"}, result_example = "Operation in progress, delete 5000 messages"},
#ejabberd_commands{name = abort_delete_old_mam_messages, tags = [purge], #ejabberd_commands{name = abort_delete_old_mam_messages, tags = [mam, purge],
desc = "Abort currently running delete old MAM messages operation", desc = "Abort currently running delete old MAM messages operation",
note = "added in 22.05", note = "added in 22.05",
module = ?MODULE, function = delete_old_messages_abort, module = ?MODULE, function = delete_old_messages_abort,