mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-19 14:03:03 +02:00
The archive_msg export fun requires MUC Service for room archives
This commit is contained in:
parent
2229e4c6db
commit
796f567db1
@ -165,12 +165,18 @@ import_info(Mod) ->
|
|||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
export(LServer, Table, IO, ConvertFun) ->
|
export(LServer, Table, IO, ConvertFun) ->
|
||||||
DbType = ejabberd_option:sql_type(LServer),
|
DbType = ejabberd_option:sql_type(LServer),
|
||||||
|
LServerConvert = case Table of
|
||||||
|
archive_msg ->
|
||||||
|
[LServer | mod_muc_admin:find_hosts(LServer)];
|
||||||
|
_ ->
|
||||||
|
LServer
|
||||||
|
end,
|
||||||
F = fun () ->
|
F = fun () ->
|
||||||
mnesia:read_lock_table(Table),
|
mnesia:read_lock_table(Table),
|
||||||
{_N, SQLs} =
|
{_N, SQLs} =
|
||||||
mnesia:foldl(
|
mnesia:foldl(
|
||||||
fun(R, {N, SQLs} = Acc) ->
|
fun(R, {N, SQLs} = Acc) ->
|
||||||
case ConvertFun(LServer, R) of
|
case ConvertFun(LServerConvert, R) of
|
||||||
[] ->
|
[] ->
|
||||||
Acc;
|
Acc;
|
||||||
SQL1 ->
|
SQL1 ->
|
||||||
|
@ -362,10 +362,10 @@ export(_Server) ->
|
|||||||
[]
|
[]
|
||||||
end},
|
end},
|
||||||
{archive_msg,
|
{archive_msg,
|
||||||
fun(Host, #archive_msg{us ={LUser, LServer},
|
fun([Host | HostTail], #archive_msg{us ={LUser, LServer},
|
||||||
id = _ID, timestamp = TS, peer = Peer,
|
id = _ID, timestamp = TS, peer = Peer,
|
||||||
type = Type, nick = Nick, packet = Pkt})
|
type = Type, nick = Nick, packet = Pkt})
|
||||||
when LServer == Host ->
|
when (LServer == Host) or ([LServer] == HostTail) ->
|
||||||
TStmp = misc:now_to_usec(TS),
|
TStmp = misc:now_to_usec(TS),
|
||||||
SUser = case Type of
|
SUser = case Type of
|
||||||
chat -> LUser;
|
chat -> LUser;
|
||||||
|
Loading…
Reference in New Issue
Block a user