diff options
author | Badlop <badlop@process-one.net> | 2021-08-27 12:38:47 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2022-09-16 16:35:00 +0200 |
commit | 796f567db1857c9605791217ba6f00d459a2106a (patch) | |
tree | ac8b5df4320b97de22bbf3f4e50f24249273b4a5 | |
parent | Allow MUC service admins to bypass max_user_conferences limitation (diff) |
The archive_msg export fun requires MUC Service for room archives
-rw-r--r-- | src/ejd2sql.erl | 8 | ||||
-rw-r--r-- | src/mod_mam_sql.erl | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/ejd2sql.erl b/src/ejd2sql.erl index 6afad112c..469457048 100644 --- a/src/ejd2sql.erl +++ b/src/ejd2sql.erl @@ -165,12 +165,18 @@ import_info(Mod) -> %%%---------------------------------------------------------------------- export(LServer, Table, IO, ConvertFun) -> DbType = ejabberd_option:sql_type(LServer), + LServerConvert = case Table of + archive_msg -> + [LServer | mod_muc_admin:find_hosts(LServer)]; + _ -> + LServer + end, F = fun () -> mnesia:read_lock_table(Table), {_N, SQLs} = mnesia:foldl( fun(R, {N, SQLs} = Acc) -> - case ConvertFun(LServer, R) of + case ConvertFun(LServerConvert, R) of [] -> Acc; SQL1 -> diff --git a/src/mod_mam_sql.erl b/src/mod_mam_sql.erl index 9eb9716fb..09175d83f 100644 --- a/src/mod_mam_sql.erl +++ b/src/mod_mam_sql.erl @@ -362,10 +362,10 @@ export(_Server) -> [] end}, {archive_msg, - fun(Host, #archive_msg{us ={LUser, LServer}, + fun([Host | HostTail], #archive_msg{us ={LUser, LServer}, id = _ID, timestamp = TS, peer = Peer, type = Type, nick = Nick, packet = Pkt}) - when LServer == Host -> + when (LServer == Host) or ([LServer] == HostTail) -> TStmp = misc:now_to_usec(TS), SUser = case Type of chat -> LUser; |