diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2018-03-05 01:10:12 +0100 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2018-03-05 01:10:12 +0100 |
commit | 67fe5d38a7a901335ca1ca814f09ad38afd5367a (patch) | |
tree | 6b8e08931b702dc9433e1e5d56903e2bc5188142 /src | |
parent | Revert "Support for default values in default_room_opts" (diff) |
mod_push_keepalive: Preserve timeout on resumption
Don't forget to carry over the original XEP-0198 resumption timeout
value while resuming.
Diffstat (limited to 'src')
-rw-r--r-- | src/mod_push_keepalive.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mod_push_keepalive.erl b/src/mod_push_keepalive.erl index 35932a815..750427ee1 100644 --- a/src/mod_push_keepalive.erl +++ b/src/mod_push_keepalive.erl @@ -156,9 +156,15 @@ c2s_session_resumed(State) -> -spec c2s_copy_session(c2s_state(), c2s_state()) -> c2s_state(). c2s_copy_session(State, #{push_enabled := true, push_resume_timeout := ResumeTimeout, - push_wake_on_timeout := WakeOnTimeout}) -> - State#{push_resume_timeout => ResumeTimeout, - push_wake_on_timeout => WakeOnTimeout}; + push_wake_on_timeout := WakeOnTimeout} = OldState) -> + State1 = case maps:find(push_resume_timeout_orig, OldState) of + {ok, Val} -> + State#{push_resume_timeout_orig => Val}; + error -> + State + end, + State1#{push_resume_timeout => ResumeTimeout, + push_wake_on_timeout => WakeOnTimeout}; c2s_copy_session(State, _) -> State. |