Fix problem with handling of old db entries in mod_mam

This commit is contained in:
Paweł Chmielowski 2015-12-09 09:46:45 +01:00
parent 07baf2d973
commit be4d687a86
1 changed files with 4 additions and 3 deletions

View File

@ -712,9 +712,10 @@ select(LServer, #jid{luser = LUser} = JidRequestor,
#xmlel{} = El = xml_stream:parse_element(XML),
Now = usec_to_now(jlib:binary_to_integer(TS)),
PeerJid = jid:tolower(jid:from_string(PeerBin)),
T = if Kind /= <<"">> ->
jlib:binary_to_atom(Kind);
true -> chat
T = case Kind of
<<"">> -> chat;
null -> chat;
_ -> jlib:binary_to_atom(Kind)
end,
{TS, jlib:binary_to_integer(TS),
msg_to_el(#archive_msg{timestamp = Now,