mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-18 22:15:20 +02:00
prosody2ejabberd: Fix offline message record type
mod_offline now expects a #message{} rather than an #xmlel{} record.
This commit is contained in:
parent
a1068df602
commit
e469b6ffb4
|
@ -341,19 +341,24 @@ el_to_offline_msg(LUser, LServer, #xmlel{attrs = Attrs} = El) ->
|
||||||
({<<"stamp_legacy">>, _}) -> false;
|
({<<"stamp_legacy">>, _}) -> false;
|
||||||
(_) -> true
|
(_) -> true
|
||||||
end, Attrs),
|
end, Attrs),
|
||||||
Packet = El#xmlel{attrs = Attrs1},
|
El1 = El#xmlel{attrs = Attrs1},
|
||||||
From = jid:decode(fxml:get_attr_s(<<"from">>, Attrs)),
|
case xmpp:decode(El1, ?NS_CLIENT, [ignore_els]) of
|
||||||
To = jid:decode(fxml:get_attr_s(<<"to">>, Attrs)),
|
#message{from = #jid{} = From, to = #jid{} = To} = Packet ->
|
||||||
[#offline_msg{
|
[#offline_msg{
|
||||||
us = {LUser, LServer},
|
us = {LUser, LServer},
|
||||||
timestamp = TS,
|
timestamp = TS,
|
||||||
expire = never,
|
expire = never,
|
||||||
from = From,
|
from = From,
|
||||||
to = To,
|
to = To,
|
||||||
packet = Packet}]
|
packet = Packet}];
|
||||||
|
_ ->
|
||||||
|
[]
|
||||||
|
end
|
||||||
catch _:{bad_timestamp, _} ->
|
catch _:{bad_timestamp, _} ->
|
||||||
[];
|
[];
|
||||||
_:{bad_jid, _} ->
|
_:{bad_jid, _} ->
|
||||||
|
[];
|
||||||
|
_:{xmpp_codec, _} ->
|
||||||
[]
|
[]
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user