]> granicus.if.org Git - ejabberd/commitdiff
Include original 'id' and 'type' attributes in offline event
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Tue, 25 Apr 2017 14:59:26 +0000 (17:59 +0300)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Tue, 25 Apr 2017 14:59:26 +0000 (17:59 +0300)
src/mod_offline.erl

index 1d4a639585742438e33bcc0ba95b39062d5b6d18..373200c124a6e03b1795a4044255edda69070f7e 100644 (file)
@@ -532,14 +532,14 @@ has_no_store_hint(Packet) ->
 
 %% Check if the packet has any content about XEP-0022
 -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
        false ->
            true;
        #xevent{id = undefined, offline = false} ->
            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}]},
            ejabberd_router:route(NewMsg),
            true;