1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-03 09:49:18 +02:00

Include original 'id' and 'type' attributes in offline event

This commit is contained in:
Evgeniy Khramtsov 2017-04-25 17:59:26 +03:00
parent a67b3dc6a6
commit 120682ec8b

View file

@ -532,14 +532,14 @@ has_no_store_hint(Packet) ->
%% Check if the packet has any content about XEP-0022 %% Check if the packet has any content about XEP-0022
-spec check_event(message()) -> boolean(). -spec check_event(message()) -> boolean().
check_event(#message{from = From, to = To, id = ID} = Msg) -> check_event(#message{from = From, to = To, id = ID, type = Type} = Msg) ->
case xmpp:get_subtag(Msg, #xevent{}) of case xmpp:get_subtag(Msg, #xevent{}) of
false -> false ->
true; true;
#xevent{id = undefined, offline = false} -> #xevent{id = undefined, offline = false} ->
true; true;
#xevent{id = undefined, offline = true} -> #xevent{id = undefined, offline = true} ->
NewMsg = #message{from = To, to = From, NewMsg = #message{from = To, to = From, id = ID, type = Type,
sub_els = [#xevent{id = ID, offline = true}]}, sub_els = [#xevent{id = ID, offline = true}]},
ejabberd_router:route(NewMsg), ejabberd_router:route(NewMsg),
true; true;