When exporting mod_mam, MUC entries are assigned to the MUC service (#3680)

This commit is contained in:
Badlop 2021-09-21 12:16:30 +02:00
parent c9c5839da4
commit cfc393a12e
1 changed files with 10 additions and 5 deletions

View File

@ -73,11 +73,16 @@ export(Server, Output) ->
end, Modules),
close_output(Output, IO).
export(Server, Output, Module1) ->
Module = case Module1 of
mod_pubsub -> pubsub_db;
_ -> Module1
end,
export(Server, Output, mod_mam = M1) ->
MucServices = gen_mod:get_module_opt_hosts(Server, mod_muc),
[export2(MucService, Output, M1, M1) || MucService <- MucServices],
export2(Server, Output, M1, M1);
export(Server, Output, mod_pubsub = M1) ->
export2(Server, Output, M1, pubsub_db);
export(Server, Output, M1) ->
export2(Server, Output, M1, M1).
export2(Server, Output, Module1, Module) ->
SQLMod = gen_mod:db_mod(sql, Module),
LServer = jid:nameprep(iolist_to_binary(Server)),
IO = prepare_output(Output),