24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-16 22:05:29 +02:00

Fix username in mam export (#1510)(thanks to themaverik)

This commit is contained in:
Badlop 2017-06-26 14:38:12 +02:00
parent 4ef1cdec12
commit 1bfb0ab39c

View File

@ -198,15 +198,14 @@ export(_Server) ->
[]
end},
{archive_msg,
fun(Host, #archive_msg{us ={_LUser, LServer},
fun(Host, #archive_msg{us ={LUser, LServer},
id = _ID, timestamp = TS, peer = Peer,
bare_peer = {PUser, PServer, <<>>},
type = Type, nick = Nick, packet = Pkt})
when LServer == Host ->
TStmp = now_to_usec(TS),
SUser = case Type of
chat -> PUser;
groupchat -> jid:encode({PUser, PServer, <<>>})
chat -> LUser;
groupchat -> jid:encode({LUser, LServer, <<>>})
end,
BarePeer = jid:encode(jid:tolower(jid:remove_resource(Peer))),
LPeer = jid:encode(jid:tolower(Peer)),